Skip to content

Commit 88aeaa7

Browse files
authored
allow viamrobotics members to release (#184)
1 parent 66875c8 commit 88aeaa7

File tree

2 files changed

+29
-2
lines changed

2 files changed

+29
-2
lines changed

.github/workflows/publish.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,26 @@ jobs:
99
publish:
1010
if: |
1111
github.repository_owner == 'viamrobotics'
12-
&& ((github.event_name == 'workflow_dispatch' && contains(fromJson('["njooma"]'), github.actor)) || github.event_name == 'release')
12+
&& (github.event_name == 'workflow_dispatch' || github.event_name == 'release')
1313
runs-on: [self-hosted, x64]
1414
container:
1515
image: ghcr.io/viamrobotics/canon:amd64
1616

1717
steps:
18+
- name: Check if organization member
19+
id: is_organization_member
20+
if: github.event_name == 'workflow_dispatch'
21+
uses: jamessingleton/[email protected]
22+
with:
23+
organization: viamrobotics
24+
username: ${{ github.actor }}
25+
token: ${{ secrets.GITHUB_TOKEN }}
26+
27+
- name: cancelling
28+
uses: andymckay/[email protected]
29+
if: |
30+
github.event_name == 'workflow_dispatch' && steps.is_organization_member.outputs.result == 'false'
31+
1832
- name: Download Release
1933
uses: dsaltares/fetch-gh-release-asset@master
2034
with:

.github/workflows/release.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,27 @@ on:
2020

2121
jobs:
2222
prepare:
23-
if: github.repository_owner == 'viamrobotics' && github.ref == 'refs/heads/main' && contains(fromJson('["njooma"]'), github.actor)
23+
if: github.repository_owner == 'viamrobotics' && github.ref == 'refs/heads/main')
2424
runs-on: [self-hosted, x64]
2525
container:
2626
image: ghcr.io/viamrobotics/canon:amd64
2727
outputs:
2828
sha: ${{ steps.commit.outputs.commit_long_sha }}
2929
version: ${{ steps.bump_version.outputs.version }}
3030
steps:
31+
- name: Check if organization member
32+
id: is_organization_member
33+
uses: jamessingleton/[email protected]
34+
with:
35+
organization: viamrobotics
36+
username: ${{ github.actor }}
37+
token: ${{ secrets.GITHUB_TOKEN }}
38+
39+
- name: cancelling
40+
uses: andymckay/[email protected]
41+
if: |
42+
steps.is_organization_member.outputs.result == 'false'
43+
3144
- name: Checkout Code
3245
uses: actions/checkout@v3
3346
with:

0 commit comments

Comments
 (0)