Skip to content

update permissions for GH release actions (#153) #35

update permissions for GH release actions (#153)

update permissions for GH release actions (#153) #35

# Creates or updates a release's generated PDF when a change occurs
# to a release branch
name: On Release Branch Change
on:
push:
branches:
- "release/*"
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write # Note: Needed in order to generate a tag on the associated commit.
steps:
- name: Set up Git repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set origin HEAD
run: git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/main
- name: Extract branch name
shell: bash
run: echo "RELEASE_NAME=$(echo ${GITHUB_REF#refs/heads/release/})" >> $GITHUB_ENV
- name: Compile document
uses: xu-cheng/latex-action@v2
with:
root_file: ifc.tex
working_directory: ltx
- name: Compile changelog
run: |
echo 'CHANGELOG<<EOF' >> $GITHUB_ENV
ruby ./.github/workflows/compile-changelog.rb $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- name: Update release
uses: ncipollo/release-action@v1
with:
token: "${{ secrets.GITHUB_TOKEN }}"
allowUpdates: true
name: ${{ env.RELEASE_NAME }}
prerelease: false
tag: ${{ env.RELEASE_NAME }}
body: |
# Changelog
${{ env.CHANGELOG }}
artifacts: |
ltx/ifc.pdf