Skip to content

1.0.1

1.0.1 #6

Workflow file for this run

# This workflow will run when a release is created, and automatically update GitHub issue templates
name: GitHub Release
on:
release:
types: [published]
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
ref: 'main' # Otherwise, this action will checkout the tag that was created during publishing
- name: Create branch
id: checkout
run: .github/scripts/checkout.sh update-templates-${{ github.sha }}
- name: Insert release - ${{ github.event.release.tag_name }}
uses: mikefarah/yq@bbdd97482f2d439126582a59689eb1c855944955 #v4.44.3
with:
cmd: |
yq -i '( .body.[] | select(.id == "version") ) ref $x | $x .attributes.options = ["${{ github.event.release.tag_name }}"] + $x .attributes.options' .github/ISSUE_TEMPLATE/bug-report.yml &&
yq -i '( .body.[] | select(.id == "version") ) ref $x | $x .attributes.options = ["${{ github.event.release.tag_name }}"] + $x .attributes.options' .github/ISSUE_TEMPLATE/tck-challenge.yml
- name: Needs updates
id: update
run: echo "update_count=$(git status -s -uno | wc -l)" >> $GITHUB_OUTPUT
- name: Create commit
if: steps.update.outputs.update_count > 0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
git add .github/ISSUE_TEMPLATE/bug-report.yml
git add .github/ISSUE_TEMPLATE/tck-challenge.yml
git commit -m "Update templates to include release ${{ github.event.release.tag_name }}"
git push origin update-templates-${{ github.sha }}
pull-request:
needs: [update]
uses: ./.github/workflows/pull-request.yml
with:
branch: 'update-templates-${{ github.sha }}'
title: 'Update templates to include release ${{ github.event.release.tag_name }}'
body: 'generated pull request'