Update Adyen/adyen-swift-public-api-diff action to v0.11.2 #8504
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: 🏷️ Validate PR labels and release notes | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened, labeled, unlabeled, edited] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| pull-requests: write # post PR comment | |
| jobs: | |
| get-pr-labels: | |
| if: "!startsWith(github.event.pull_request.head.ref, 'release/') && !contains(github.event.pull_request.user.login, '[bot]')" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Fetch repo | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Get the list of allowed pull request labels | |
| run: | | |
| RED='\033[0;31m' | |
| NC='\033[0m' | |
| FILE_NAME=.pull-requests-allowed-labels-list | |
| FILE_PATH=$PROJECT_ROOT/$FILE_NAME | |
| if [[ ! -f "$FILE_PATH" ]]; then | |
| echo -e "${RED}$FILE_NAME file doesn't exist in the root of the repository${NC}" | |
| exit 1 | |
| fi | |
| echo "LABELS=$(cat $FILE_PATH),chore,improvement" >> $GITHUB_OUTPUT | |
| id: get-allowed_labels | |
| env: | |
| PROJECT_ROOT: ${{ github.workspace }} | |
| - name: Validate labels | |
| uses: jesusvasquez333/verify-pr-label-action@v1.4.0 | |
| with: | |
| github-token: '${{ secrets.GITHUB_TOKEN }}' | |
| valid-labels: ${{ steps.get-allowed_labels.outputs.LABELS }} | |
| - name: Get PR labels | |
| uses: joerick/pr-labels-action@v1.0.9 | |
| id: pr-labels | |
| - run: | | |
| ALLOWED_LABELS="$ALLOWED_LABELS,chore,improvement" | |
| IFS=',' read -r -a ALLOWED_LABELS_ARRAY <<< "$ALLOWED_LABELS" | |
| SHOULD_FAIL_JOB="false" | |
| RED='\033[0;31m' | |
| NC='\033[0m' | |
| for LABEL in "${ALLOWED_LABELS_ARRAY[@]}"; do | |
| LABEL=$(echo "$LABEL" | sed 's/^ *//g' | sed 's/ *$//g') | |
| if [[ "$LABEL" == "chore" || "$LABEL" == "improvement" ]]; then | |
| continue | |
| fi | |
| if [[ "$PR_LABELS" == *"$LABEL"* ]]; then | |
| cmd="awk '/<$LABEL>.*<\/$LABEL>/'" | |
| FEATURE_RELEASE_NOTE="$(echo $PR_BODY | eval $cmd)" | |
| if [[ -z "$FEATURE_RELEASE_NOTE" ]]; then | |
| echo -e "${RED}Pull requests labeled with '$LABEL' must have the release note in the pull request body in the following format '<$LABEL> {THE RELEASE NOTE} </$LABEL>'${NC}" | |
| SHOULD_FAIL_JOB="true" | |
| fi | |
| fi | |
| done | |
| if [[ "$SHOULD_FAIL_JOB" == "true" ]]; then | |
| exit 1 | |
| fi | |
| env: | |
| PR_BODY: ${{github.event.pull_request.body}} | |
| PR_LABELS: ${{steps.pr-labels.outputs.labels}} | |
| ALLOWED_LABELS: ${{ steps.get-allowed_labels.outputs.LABELS }} |