Skip to content

Commit 9c1984b

Browse files
authored
Add placeholder action to publish to NPM (#238)
## Description Commit 0bdf44c removes the GitHub Action to publish to NPM. This action is supposed to be available only on branch `v1`, however GitHub requires `workflow_dispatch` actions to appear on the default branch in order to be triggered through the [Action overview page](https://github.com/cowprotocol/contracts/actions). From the [docs](https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#onworkflow_dispatch): > This trigger only receives events when the workflow file is on the default branch. This PR creates a no-op action that would make it possible to trigger the action with the same name on `v1`. There appear to be [workarounds](https://stackoverflow.com/questions/63362126/github-actions-how-can-i-run-a-workflow-created-on-a-non-master-branch-from-t/71057825#71057825) to not pollute the default branch, however the approach of recreating the action on `main` seems less likely to break in the future. ## Test Plan Compare with [the corresponding action on `v1`](https://github.com/cowprotocol/contracts/blob/v1/.github/workflows/publish.yml) and confirm that the name and references are the same.
1 parent 0bdf44c commit 9c1984b

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

.github/workflows/publish.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# This is a placeholder GitHub Action with the sole purpose of making this
2+
# action appear on the Action interface. It isn't supposed to be executed on
3+
# the current branch, only on the `v1` branch.
4+
# Related discussion: https://github.com/github/docs/issues/31007
5+
6+
name: Publish package to NPM
7+
8+
on:
9+
workflow_dispatch:
10+
11+
jobs:
12+
deploy:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v3
16+
- name: Print warning
17+
run: echo 'Publishing this branch to NPM is not supported'
18+
- name: Make the action fail
19+
run: exit 1

0 commit comments

Comments
 (0)