Skip to content

Commit

Permalink
Create publish-immutable-action workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Eisenberg committed Oct 11, 2024
1 parent ea2cd92 commit 5fb6f12
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/publish-immutable-action.yml
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

0 comments on commit 5fb6f12

Please sign in to comment.