-
Notifications
You must be signed in to change notification settings - Fork 7
41 lines (37 loc) · 1.5 KB
/
create-gh-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: "6. Auto-create GitHub release"
on:
push:
tags:
- "v*.*.*"
jobs:
create-gh-release:
runs-on: ubuntu-latest
steps:
- name: "Checkout source code"
uses: actions/checkout@v3
- name: "Check if release already exists"
id: check-release
env:
GH_TOKEN: ${{ github.token }}
run: |
echo "Tag name from github.ref_name: ${{ github.ref_name }}"
if gh release view ${{ github.ref_name }}; then
# This workflow is triggered more than once in the internal repo.
# Subsequent runs are undesirable, so don't continue.
# See notes at https://github.com/department-of-veterans-affairs/abd-vro/issues/1955
echo "continue=false" >> "$GITHUB_OUTPUT"
echo "Skipping b/c GitHub release ${{ github.ref_name }} already exists." | tee -a "$GITHUB_STEP_SUMMARY"
else
echo "continue=true" >> "$GITHUB_OUTPUT"
fi
- name: "Create GitHub Release"
if: steps.check-release.outputs.continue == 'true'
uses: softprops/action-gh-release@v1
with:
name: "${{ github.ref_name }}-auto"
# Use a token so that auto-creating a GH Release will trigger the SecRel workflow
token: ${{ secrets.ACCESS_TOKEN_PUSH_TO_DEVELOP }}
prerelease: true
generate_release_notes: true
append_body: true
body: "Automatically created by create-gh-release GitHub Action (run #${{github.run_number}})"