Title: PR creation does not trigger workflow · Issue #484 · actions/github-script · GitHub
Open Graph Title: PR creation does not trigger workflow · Issue #484 · actions/github-script
X Title: PR creation does not trigger workflow · Issue #484 · actions/github-script
Description: Describe the bug I want to automate the creation of a PR to release a Python package with a "release_pr" workflow triggered by the push of the underlying branch, as follows (full workflow: release_pr.yml): name: release_pr on: push: # Wh...
Open Graph Description: Describe the bug I want to automate the creation of a PR to release a Python package with a "release_pr" workflow triggered by the push of the underlying branch, as follows (full workflow: release_...
X Description: Describe the bug I want to automate the creation of a PR to release a Python package with a "release_pr" workflow triggered by the push of the underlying branch, as follows (full workflow...
Opengraph URL: https://github.com/actions/github-script/issues/484
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"PR creation does not trigger workflow","articleBody":"**Describe the bug**\r\n\r\nI want to automate the creation of a PR to release a Python package with a \"release_pr\" workflow triggered by the push of the underlying branch, as follows (full workflow: [release_pr.yml](https://github.com/zhmcclient/python-zhmcclient/blob/master/.github/workflows/release_pr.yml)):\r\n\r\n```\r\nname: release_pr\r\n\r\non:\r\n push: # When pushing a release branch\r\n branches:\r\n # Release branch formats:\r\n # release_M.N.U - targets a default branch (master for M.N.0, stable_M.N otherwise)\r\n # release_M.N.0_BRANCH - targets the specified branch\r\n - release_*\r\n\r\njobs:\r\n release_pr:\r\n name: Create the release PR\r\n runs-on: ubuntu-latest\r\n steps:\r\n\r\n . . .\r\n\r\n - name: Create PR on Github for the pushed release branch\r\n uses: actions/github-script@v7\r\n with:\r\n script: |\r\n github.rest.pulls.create({\r\n owner: context.repo.owner,\r\n repo: context.repo.repo,\r\n title: \"Release ${{ steps.set-version.outputs.result }}\",\r\n body: \"Merging this PR will trigger the publishing to PyPI.\",\r\n head: \"${{ github.ref_name }}\",\r\n base: \"${{ steps.set-target-branch.outputs.result }}\",\r\n });\r\n env:\r\n GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\r\n```\r\n\r\nThe PR gets created successfully by this workflow, e.g.: https://github.com/zhmcclient/python-zhmcclient/pull/1641\r\n\r\nThere is a second workflow \"test\" that is set to trigger when a PR is created. However, that second workflow is not actually triggered when the PR is created using actions/github-script (but it is triggered when manually creating a PR).\r\n\r\nThe trigger section of the \"test\" workflow is as follows (full workflow: [test.yml](https://github.com/zhmcclient/python-zhmcclient/blob/master/.github/workflows/test.yml))\r\n\r\n```\r\nname: test\r\n\r\non:\r\n schedule:\r\n # The schedule event always (and only) runs on the master branch.\r\n - # cron (in UTC): minute hour day_of_month month day_of_week\r\n cron: '00 22 * * SAT'\r\n pull_request: # When creating a PR targeting these branches\r\n branches:\r\n - master\r\n - stable_*\r\n push: # When merging a PR targeting these branches (direct push is disabled)\r\n branches:\r\n - master\r\n - stable_*\r\n\r\njobs:\r\n . . .\r\n```\r\n\r\nSince the created release PR targets either the \"master\" or \"stable_M.N\" branch, the \"pull_request\" trigger should trigger when a PR is created through the actions/github-script code (just as it does when such a PR is created manually), but it is not actually triggered.\r\n\r\nDo you have an idea why the \"test\" workflow it is not triggered through the actions/github-script code?\r\n\r\nWhat is different in the way the actions/github-script code creates the PR compared to creating the PR manually, that would influence the subsequent triggering of actions?\r\n\r\n**To Reproduce**\r\nSteps to reproduce the behavior (requires push permissions to the repo):\r\n1. Clone the repo https://github.com/zhmcclient/python-zhmcclient locally \r\n2. Create a virtual Python environment using Python 3.8 or higher and have that env active\r\n3. Go to the main directory of the local repo clone\r\n3. Run \"make develop\" - this will install necessary Python packages\r\n4. Run \"VERSION=1.18.0 make release_branch\" - this will create a release branch and push that branch, which triggers the \"release_pr\" workflow.\r\n5. Look at the \"Actions\" tab to verify that the \"test\" workflow was not run.\r\n\r\n**Expected behavior**\r\n\r\nPR creation through the actions/github-script code should have the same Actions trigger behavior as creating a PR manually through the Github GUI.\r\n\r\n**Screenshots**\r\nN/A\r\n\r\n**Desktop (please complete the following information):**\r\n - OS: MacOS 14.6.1\r\n - Browser: Firefox\r\n \r\n**Smartphone (please complete the following information):**\r\nN/A\r\n\r\n**Additional context**\r\nN/A","author":{"url":"https://github.com/andy-maier","@type":"Person","name":"andy-maier"},"datePublished":"2024-09-04T08:42:23.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/484/github-script/issues/484"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:29f26ec5-5356-d904-21bf-d715547edda1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A808:73358:842ECC:B9B449:6A510601 |
| html-safe-nonce | a28e83e1b47141b547665246c25f51b6cf908ae2e1b5719f64cb26f83dfe5a0e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBODA4OjczMzU4Ojg0MkVDQzpCOUI0NDk6NkE1MTA2MDEiLCJ2aXNpdG9yX2lkIjoiMzIxODY3Mjk0NzgyMzI2MjczIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | e391b75af5f056501c999e5ac850d3c08904035b8b5bbb1dcd7c8daa425b66f9 |
| hovercard-subject-tag | issue:2504683548 |
| github-keyboard-shortcuts | repository,issues,actions,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/actions/github-script/484/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6e516d11a44a420ac21486301875b1386b2876f41b7be5a90db56086d62e9847/actions/github-script/issues/484 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6e516d11a44a420ac21486301875b1386b2876f41b7be5a90db56086d62e9847/actions/github-script/issues/484 |
| og:image:alt | Describe the bug I want to automate the creation of a PR to release a Python package with a "release_pr" workflow triggered by the push of the underlying branch, as follows (full workflow: release_... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | andy-maier |
| hostname | github.com |
| expected-hostname | github.com |
| None | 38906a4da4e3e9fd88dfeacee232f5932c0c5f7495de3b4efc53ddfac7173d12 |
| turbo-cache-control | no-preview |
| go-import | github.com/actions/github-script git https://github.com/actions/github-script.git |
| octolytics-dimension-user_id | 44036562 |
| octolytics-dimension-user_login | actions |
| octolytics-dimension-repository_id | 205262760 |
| octolytics-dimension-repository_nwo | actions/github-script |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 205262760 |
| octolytics-dimension-repository_network_root_nwo | actions/github-script |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 90441ea9b98e7491aa6ebcd135fccce4e2396f48 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width