gh-action-bump-version icon indicating copy to clipboard operation
gh-action-bump-version copied to clipboard

Version bumping on a derived workflow

Open mpermar opened this issue 2 years ago • 0 comments

We are using this action as part of a Validate -> Release workflow. Validate runs both on Pull Requests and merge to main. But only when merging into main we trigger another workflow that will do the release with this action.

Now the problem is that this derived workflow uses the workflow_run trigger like below:

on:
  workflow_run:
    workflows:
      - Validate
    types:
      - completed
    branches:
      - main

A workflow_run event does not have any commits field but it rather has a head_commit attribute instead, like this:

"workflow_run": {
...
  "head_commit": {
      "author": {
        "email": "mpermar@***",
        "name": "mpermar"
      },
      "committer": {
        "email": "[email protected]",
        "name": "GitHub"
      },
      "id": "0f5626206622c61af80ae943b404511b5e90050b",
      "message": "feat: Print event from path on release. (bump test)\n\nfeat: Print event from path on release. (bump test)\r\n\r\nSigned-off-by: Martin Perez <martinpe@***>",
      "timestamp": "2022-04-27T09:46:57Z",
      "tree_id": "941799335b28e9dfe592a6ba059a186d3997696f"
    },
...
}

I should be able to write a Pull Request for this but I want to check with you if it makes sense and would be open to take it as otherwise I would have to find some other workaround.

mpermar avatar Apr 27 '22 10:04 mpermar