Skip to content

Commit abca4cc

Browse files
Add dispatch trigger and restrictions to changeset converter. (RooCodeInc#2735)
* Add dispatch trigger and restrictions to changeset converter. * Update .github/workflows/changeset-converter.yml Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> * Update action to specific version * Fix format, Update package-lock version --------- Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
1 parent 73c64d9 commit abca4cc

File tree

2 files changed

+29
-8
lines changed

2 files changed

+29
-8
lines changed

.github/workflows/changeset-converter.yml

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: Changeset Converter
22
run-name: Changeset Conversion
33

44
on:
5+
workflow_dispatch:
56
pull_request:
67
types: [closed]
78

@@ -13,16 +14,36 @@ env:
1314
jobs:
1415
# Job 1: Create version bump PR when changesets are merged to main
1516
changeset-pr-version-bump:
16-
if: >
17-
github.event_name == 'pull_request' &&
18-
github.event.pull_request.merged == true &&
19-
github.event.pull_request.base.ref == 'main' &&
20-
github.actor != 'github-actions'
21-
runs-on: ubuntu-latest
17+
if: |
18+
github.event_name == 'workflow_dispatch' ||
19+
(
20+
github.event_name == 'pull_request' &&
21+
github.event.pull_request.merged == true &&
22+
github.event.pull_request.base.ref == 'main' &&
23+
github.actor != 'github-actions'
24+
)
25+
runs-on: ubuntu-latest`
2226
permissions:
2327
contents: write
2428
pull-requests: write
2529
steps:
30+
- name: Check user for team affiliation
31+
id: team_check
32+
if: github.event_name == 'workflow_dispatch'
33+
uses: morfien101/actions-authorized-user@4a3cfbf0bcb3cafe4a71710a278920c5d94bb38b
34+
with:
35+
username: ${{ github.actor }}
36+
team: "deployer"
37+
github_token: ${{ secrets.GITHUB_TOKEN }}
38+
39+
- name: Check if user is authorized
40+
if: github.event_name == 'workflow_dispatch'
41+
run: |
42+
if [ "${{ steps.team_check.outputs.authorized }}" != "true" ]; then
43+
echo "User is not authorized to run this workflow."
44+
exit 1
45+
fi
46+
2647
- name: Git Checkout
2748
uses: actions/checkout@v4
2849
with:

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)