-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create publish-immutable-action workflow
- Loading branch information
Andrew Eisenberg
committed
Oct 11, 2024
1 parent
ea2cd92
commit 5fb6f12
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| name: 'Publish Immutable Action Version' | ||
|
|
||
| on: | ||
| release: | ||
| types: [published] | ||
|
|
||
| jobs: | ||
| publish: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
| packages: write | ||
|
|
||
| steps: | ||
| - name: Check release name | ||
| id: check | ||
| env: | ||
| RELEASE_NAME: ${{ github.event.release.name }} | ||
| run: | | ||
| echo "Release name: ${{ github.event.release.name }}" | ||
| if [[ $RELEASE_NAME == v* ]]; then | ||
| echo "This is a CodeQL Action release. Create an Immutable Action" | ||
| echo "is-action-release=true" >> $GITHUB_OUTPUT | ||
| else | ||
| echo "This is a CodeQL Bundle release. Do not create an Immutable Action" | ||
| echo "is-action-release=false" >> $GITHUB_OUTPUT | ||
| fi | ||
| - name: Checking out | ||
| if: steps.check.outputs.is-action-release == 'true' | ||
| uses: actions/checkout@v4 | ||
| - name: Publish | ||
| if: steps.check.outputs.is-action-release == 'true' | ||
| id: publish | ||
| uses: actions/publish-immutable-action@0.0.3 |