1.0.0-M3 #4
Workflow file for this run
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
# 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@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- 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@1cf9ecc79df9cabe69ae75a0bbfa7df7f9fe8a2f #v4.40.2 | |
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' |