Skip to content

Commit 1df6590

Browse files
authored
Merge pull request #2541 from github/aeisenberg/publish-immutable
Create publish-immutable-action workflow
2 parents dfc2731 + a5eda49 commit 1df6590

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: 'Publish Immutable Action Version'
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
12+
id-token: write
13+
packages: write
14+
15+
steps:
16+
- name: Check release name
17+
id: check
18+
env:
19+
RELEASE_NAME: ${{ github.event.release.name }}
20+
run: |
21+
echo "Release name: ${{ github.event.release.name }}"
22+
if [[ $RELEASE_NAME == v* ]]; then
23+
echo "This is a CodeQL Action release. Create an Immutable Action"
24+
echo "is-action-release=true" >> $GITHUB_OUTPUT
25+
else
26+
echo "This is a CodeQL Bundle release. Do not create an Immutable Action"
27+
echo "is-action-release=false" >> $GITHUB_OUTPUT
28+
fi
29+
- name: Checking out
30+
if: steps.check.outputs.is-action-release == 'true'
31+
uses: actions/checkout@v4
32+
- name: Publish
33+
if: steps.check.outputs.is-action-release == 'true'
34+
id: publish
35+
uses: actions/[email protected]

0 commit comments

Comments
 (0)