Skip to content

Commit 7d75f2a

Browse files
authored
Update release.yml
1 parent 7ce5a1d commit 7d75f2a

1 file changed

Lines changed: 13 additions & 22 deletions

File tree

.github/workflows/release.yml

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ jobs:
1313
- uses: actions/checkout@v2
1414
with:
1515
fetch-depth: 0
16+
ref: master
1617

1718
- name: 'Get Previous tag'
1819
id: previoustag
@@ -32,56 +33,46 @@ jobs:
3233
token: ${{ secrets.GITHUB_TOKEN }}
3334
future_release: ${{ steps.version.outputs.next-version }}
3435

35-
- name: Generate changelog for the release
36-
uses: charmixer/auto-changelog-action@v1
37-
with:
38-
token: ${{ secrets.GITHUB_TOKEN }}
39-
since_tag: ${{ steps.previoustag.outputs.tag }}
40-
future_release: ${{ steps.version.outputs.next-version }}
41-
output: CHANGELOGRELEASE.md
4236

4337
- name: update inspec.yml
4438
uses: mikefarah/yq@3.2.1
4539
with:
4640
cmd: yq w -I4 -i inspec.yml version ${{ steps.version.outputs.next-version }} && sed -i '1i---' inspec.yml
4741

4842
- name: push inspec.yml and changelog
49-
uses: github-actions-x/commit@v2.6
43+
uses: github-actions-x/commit@v2.9
5044
with:
5145
github-token: ${{ secrets.GITHUB_TOKEN }}
5246
push-branch: 'master'
5347
commit-message: 'update inspec.yml and changelog'
5448
files: inspec.yml CHANGELOG.md
5549
name: dev-sec CI
5650
email: hello@dev-sec.io
57-
rebase: 'true'
51+
force-add: 'true'
52+
53+
- name: Generate changelog for the release
54+
run: |
55+
sed '/## \[${{ steps.previoustag.outputs.tag }}\]/Q' CHANGELOG.md > CHANGELOGRELEASE.md
5856
5957
- name: Read CHANGELOG.md
6058
id: package
6159
uses: juliangruber/read-file-action@v1
6260
with:
6361
path: ./CHANGELOGRELEASE.md
6462

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 }}
63+
- name: Delete old drafts
64+
uses: hugo19941994/delete-draft-releases@v1.0.0
65+
env:
66+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7567

7668
- name: Create Release draft
7769
id: create_release
78-
uses: actions/create-release@v1.1.2
70+
uses: actions/create-release@v1
7971
env:
80-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
72+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
8173
with:
8274
release_name: ${{ steps.version.outputs.next-version }}
8375
tag_name: ${{ steps.version.outputs.next-version }}
8476
body: |
8577
${{ steps.package.outputs.content }}
86-
commitish: ${{ steps.current_commitish.outputs.sha }}
8778
draft: true

0 commit comments

Comments
 (0)