@@ -55,12 +55,41 @@ jobs:
5555 fi
5656 echo "No release proposal is ongoing."
5757
58+ check-membership :
59+ permissions :
60+ id-token : write # Enable OIDC
61+ runs-on : ubuntu-latest
62+ needs : check-proposal-ongoing
63+ steps :
64+ - uses : DataDog/dd-octo-sts-action@08f2144903ced3254a3dafec2592563409ba2aa0 # v1.0.1
65+ id : octo-sts
66+ with :
67+ scope : DataDog/libdatadog # target repository
68+ policy : self.read.members # trust policy in target repo, without the .sts.yaml extension
69+
70+ - name : Check if user is in the team allowed to make crate releases
71+ id : check
72+ uses : TheModdingInquisition/actions-team-membership@057d91bb80f2976a1bc6dfab5b4ae1da9aebbd89 # v1.0.1
73+ with :
74+ team : ' apm-common-components-core'
75+ organization : ' Datadog'
76+ token : ${{ steps.octo-sts.outputs.token }} # Needs 'read:org' scope
77+ exit : false
78+
79+ - name : Check output
80+ run : |
81+ permitted=${{ steps.check.outputs.permitted }}
82+ if [[ "$permitted" != "true" ]]; then
83+ echo "User is not part of apm-common-components-core"
84+ exit 1
85+ fi
86+
5887 update-release-branch :
5988 permissions :
6089 id-token : write # Enable OIDC
6190 contents : write
6291 runs-on : ubuntu-latest
63- needs : check-proposal-ongoing
92+ needs : check-membership
6493 steps :
6594 - uses : DataDog/dd-octo-sts-action@acaa02eee7e3bb0839e4272dacb37b8f3b58ba80 # v1.0.3
6695 id : octo-sts
@@ -104,8 +133,6 @@ jobs:
104133 contents : write
105134 needs : update-release-branch
106135 runs-on : ubuntu-latest
107- # TODO: uncomment this when we have a way to test this workflow
108- # if: ${{ github.repository_owner == 'datadog' }}
109136 steps :
110137 - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2
111138 with :
0 commit comments