|  | 
| 13 | 13 |  - uses: actions/checkout@v2 | 
| 14 | 14 |  with: | 
| 15 | 15 |  fetch-depth: 0 | 
|  | 16 | + ref: master | 
| 16 | 17 | 
 | 
| 17 | 18 |  - name: 'Get Previous tag' | 
| 18 | 19 |  id: previoustag | 
| @@ -46,42 +47,38 @@ jobs: | 
| 46 | 47 |  cmd: yq w -I4 -i inspec.yml version ${{ steps.version.outputs.next-version }} && sed -i '1i---' inspec.yml | 
| 47 | 48 | 
 | 
| 48 | 49 |  - name: push inspec.yml and changelog | 
| 49 |  | - uses: github-actions-x/commit@v2.6 | 
|  | 50 | + uses: github-actions-x/commit@v2.9 | 
| 50 | 51 |  with: | 
| 51 | 52 |  github-token: ${{ secrets.GITHUB_TOKEN }} | 
| 52 | 53 |  push-branch: 'master' | 
| 53 | 54 |  commit-message: 'update inspec.yml and changelog' | 
| 54 | 55 |  files: inspec.yml CHANGELOG.md | 
| 55 | 56 |  name: dev-sec CI | 
| 56 | 57 |  email: hello@dev-sec.io | 
| 57 |  | - rebase: 'true' | 
|  | 58 | + force-add: 'true' | 
| 58 | 59 | 
 | 
|  | 60 | + - name: Generate changelog for the release | 
|  | 61 | + run: | | 
|  | 62 | + sed '/## \[${{ steps.previoustag.outputs.tag }}\]/Q' CHANGELOG.md > CHANGELOGRELEASE.md | 
| 59 | 63 |  - name: Read CHANGELOG.md | 
| 60 | 64 |  id: package | 
| 61 | 65 |  uses: juliangruber/read-file-action@v1 | 
| 62 | 66 |  with: | 
| 63 | 67 |  path: ./CHANGELOGRELEASE.md | 
| 64 | 68 | 
 | 
| 65 |  | - - uses: actions/checkout@v2 | 
| 66 |  | - with: | 
| 67 |  | - ref: master | 
| 68 |  | - | 
| 69 |  | - - name: Get current commitish | 
| 70 |  | - id: current_commitish | 
| 71 |  | - run: echo "::set-output name=sha::$(git log -1 --format="%H")" | 
| 72 |  | - | 
| 73 |  | - - name: Check it | 
| 74 |  | - run: echo ${{ steps.current_commitish.outputs.sha }} | 
|  | 69 | + - name: Delete old drafts | 
|  | 70 | + uses: hugo19941994/delete-draft-releases@v1.0.0 | 
|  | 71 | + env: | 
|  | 72 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | 
| 75 | 73 | 
 | 
| 76 | 74 |  - name: Create Release draft | 
| 77 | 75 |  id: create_release | 
| 78 |  | - uses: actions/create-release@v1.1.2 | 
|  | 76 | + uses: actions/create-release@v1 | 
| 79 | 77 |  env: | 
| 80 |  | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | 
|  | 78 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | 
| 81 | 79 |  with: | 
| 82 | 80 |  release_name: ${{ steps.version.outputs.next-version }} | 
| 83 | 81 |  tag_name: ${{ steps.version.outputs.next-version }} | 
| 84 | 82 |  body: | | 
| 85 | 83 |  ${{ steps.package.outputs.content }} | 
| 86 |  | - commitish: ${{ steps.current_commitish.outputs.sha }} | 
| 87 | 84 |  draft: true | 
0 commit comments