fix: publish auth bug #7
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
name: Build and Publish Extractor Pack | |
on: | |
push: | |
branches: ["main"] | |
workflow_dispatch: | |
permissions: | |
contents: write | |
packages: write | |
jobs: | |
compile: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: "Build Extractor" | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
./scripts/create-extractor-pack.sh | |
- name: "Publish Extractor Pack" | |
if: github.ref == 'refs/heads/main' | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
EXTRACTOR_INFO="./codeql-extractor.yml" | |
EXTRACTOR_NAME="iac" | |
EXTRACTOR_VERSION=$(grep version $EXTRACTOR_INFO | awk '{print $2}') | |
echo "[+] ${EXTRACTOR_NAME} (${EXTRACTOR_VERSION})" | |
tar czf extractor-$EXTRACTOR_NAME.tar.gz extractor-pack | |
# create release | |
gh release create "v$EXTRACTOR_VERSION" \ | |
--notes "$EXTRACTOR_NAME Extractor v$EXTRACTOR_VERSION" \ | |
extractor-$EXTRACTOR_NAME.tar.gz |