feat(audience): auto-collect platform ID on consent upgrade to Full #539
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: "Tag Release" | |
| on: | |
| pull_request: | |
| types: [closed] | |
| jobs: | |
| create-tag: | |
| if: github.event.pull_request.merged == true && (contains(github.event.pull_request.labels.*.name, 'passport-release') || contains(github.event.pull_request.labels.*.name, 'audience-release')) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.x' | |
| - name: Install jq | |
| run: sudo apt-get install -y jq | |
| - name: Extract version and set tag | |
| id: extract_version | |
| run: | | |
| IS_AUDIENCE="${{ contains(github.event.pull_request.labels.*.name, 'audience-release') }}" | |
| if [[ "$IS_AUDIENCE" == "true" ]]; then | |
| VERSION=$(jq -r .version ./src/Packages/Audience/package.json) | |
| echo "TAG=audience/v$VERSION" >> "$GITHUB_ENV" | |
| else | |
| VERSION=$(jq -r .version ./src/Packages/Passport/package.json) | |
| echo "TAG=v$VERSION" >> "$GITHUB_ENV" | |
| fi | |
| - name: Check TS SDK version exists in index.html | |
| if: contains(github.event.pull_request.labels.*.name, 'passport-release') | |
| id: check_ts_sdk_version | |
| run: | | |
| version=$(grep -oP '"x-sdk-version":"ts-immutable-sdk-\K[0-9]+\.[0-9]+\.[0-9]+' ./src/Packages/Passport/Runtime/Resources/index.html | head -n 1) | |
| if [[ -z "$version" ]]; then | |
| echo "Error: TS SDK version not found in index.html" >&2 | |
| exit 1 | |
| fi | |
| - name: Create Tag | |
| run: | | |
| SHA=$(git rev-parse HEAD) | |
| gh api /repos/${{ github.repository }}/git/refs \ | |
| --method POST \ | |
| -f ref="refs/tags/${TAG}" \ | |
| -f sha="$SHA" | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| TAG: ${{ env.TAG }} |