Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
29 changes: 20 additions & 9 deletions rules/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,15 +180,15 @@ 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 }}
export_environment_variables: true

- 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'
Expand All @@ -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
Expand Down