diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index cc45bc8..10ec57a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -60,7 +60,7 @@ jobs: - name: Create Release id: release if: inputs.push - uses: softprops/action-gh-release@v2 + uses: softprops/action-gh-release@v3 with: token: ${{ steps.app-token.outputs.token }} name: ${{ steps.bump.outputs.tag }} diff --git a/README.md b/README.md index 6c5e55a..ed38304 100644 --- a/README.md +++ b/README.md @@ -141,7 +141,7 @@ The scripts and documentation in this project are released under the [MIT Licens - [actions/upload-artifact@v7](https://github.com/actions/upload-artifact) - [aws-actions/amazon-ecr-login@v2](https://github.com/aws-actions/amazon-ecr-login) - [aws-actions/configure-aws-credentials@v6](https://github.com/aws-actions/configure-aws-credentials) - - [azure/CLI@v2](https://github.com/marketplace/actions/azure-cli-action) + - [azure/CLI@v3](https://github.com/marketplace/actions/azure-cli-action) - [azure/login@v3](https://github.com/azure/login) - [crazy-max/ghaction-github-runtime@v4](https://github.com/crazy-max/ghaction-github-runtime) - [docker/login-action@v4](https://github.com/docker/login-action) diff --git a/action.yml b/action.yml index 5ee4494..bc97aff 100644 --- a/action.yml +++ b/action.yml @@ -206,7 +206,7 @@ runs: - name: Azure CLI script id: setup-azure-cli - uses: azure/CLI@v2 + uses: azure/CLI@v3 if: env.AZURE_ENABLED == 'true' && inputs.cloud-cli == 'true' && inputs.credentials with: azcliversion: 2.57.0 diff --git a/rules/action.yml b/rules/action.yml index c3219e2..ab5e920 100644 --- a/rules/action.yml +++ b/rules/action.yml @@ -18,21 +18,32 @@ runs: steps: - name: Get User Group - uses: octokit/request-action@v2.x + uses: octokit/request-action@v3.0.0 id: get_user_groups env: GITHUB_TOKEN: ${{ inputs.github-token }} with: - route: GET /orgs/{owner}/memberships/{username} - owner: ${{ github.repository_owner }} - username: ${{ github.event.sender.login }} + route: GET /orgs/${{ github.repository_owner }}/memberships/${{ github.event.sender.login }} - - uses: tspascoal/get-user-teams-membership@v3 + - name: Get User Teams Membership id: actorTeams - with: - username: ${{ github.actor }} - team: ${{ inputs.team }} - GITHUB_TOKEN: ${{ inputs.github-token }} + shell: bash + env: + GH_TOKEN: ${{ inputs.github-token }} + run: | + IS_MEMBER="false" + MATCHED="" + IFS=',' read -ra TEAMS <<< "${{ inputs.team }}" + for TEAM in "${TEAMS[@]}"; do + TEAM=$(echo "$TEAM" | xargs) + STATE=$(gh api "/orgs/${{ github.repository_owner }}/teams/$TEAM/memberships/${{ github.actor }}" --jq '.state' 2>/dev/null) || STATE="" + if [ "$STATE" = "active" ]; then + IS_MEMBER="true" + MATCHED="${MATCHED:+$MATCHED,}$TEAM" + fi + done + echo "teams=$MATCHED" >> $GITHUB_OUTPUT + echo "isTeamMember=$IS_MEMBER" >> $GITHUB_OUTPUT - name: Display User Group shell: bash diff --git a/setup/action.yml b/setup/action.yml index 4fbe983..54ec0e4 100644 --- a/setup/action.yml +++ b/setup/action.yml @@ -180,7 +180,7 @@ runs: - name: Authenticate to Google Cloud id: login-gcp - uses: google-github-actions/auth@v2 + uses: google-github-actions/auth@v3 if: env.GCP_ENABLED == 'true' && inputs.credentials with: credentials_json: ${{ inputs.credentials }} @@ -188,7 +188,7 @@ runs: - name: Set up Cloud SDK id: setup-gcloud - uses: google-github-actions/setup-gcloud@v2 + uses: google-github-actions/setup-gcloud@v3 if: env.GCP_ENABLED == 'true' with: version: '>= 363.0.0' @@ -206,14 +206,14 @@ runs: - name: Azure Login id: login-azure - uses: azure/login@v2 + uses: azure/login@v3 if: env.AZURE_ENABLED == 'true' && inputs.credentials with: creds: ${{ inputs.credentials }} - name: Azure CLI script id: setup-azure-cli - uses: azure/CLI@v2 + uses: azure/CLI@v3 if: env.AZURE_ENABLED == 'true' && inputs.credentials with: azcliversion: 2.57.0