Modify Issue Templates with GH Actions

Continuing the discussion from Github Actions to make changes to a file:

@brightran already gave some example how to make changes to files and commit + push them.

I read somewhere that Actions cannot edit files within .github
This would include issue templates tho I would assume that you still can when you run a script or so (as pointed out by brightran in the example).

I want to shift my whole workload to Github Actions.
So when I merge a PR from master to release (branch) there is happening something.
One part is that some version number will be changed/increased. This version number is used in issue templates. So it would be nice to automatically adjust that (on push release = merge PR). As far as I know there is no way to use templates in another branch. Something like secrets (but public) would be handy. So that you simply link a variable in the issue templates and that var is pulled from repo settings like secrets.

I’m uncertain about this myself, but the pull_request_target might be relevant for you:

Hi @blackjack4494,

If the action cannot edit files within .github, it should be intentional. It depends on how the action wrote. You can use script (as sample decribed) to change the files, or choose another action instead.

One part is that some version number will be changed/increased. This version number is used in issue templates. So it would be nice to automatically adjust that (on push release = merge PR).

What do you mean “on push release = merge PR”? If you’d like to change version in the release branch, after PR merge complete, you can use a script to change it, and submit to release branch. There is an action which can submit to specified branch.

    - name: Push changes
      uses: ad-m/github-push-action@master
      with:
        repository: ...
        branch: ...     # you can specify the PR base branch here.
        github_token: ${{ secrets.GITHUB_TOKEN }}

Something like secrets (but public) would be handy. So that you simply link a variable in the issue templates and that var is pulled from repo settings like secrets.

encrypted secrets are not public, and it’s not dynamic, you cannot link it in the issue template.

Thanks