Skip to content

3.1.0-RC2

3.1.0-RC2 #4

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@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
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@c35ec752e38ea0c096d3c44e13cfc0797ac394d8 #v4.43.1
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'