update yarn #363
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: 'Publish Release Candidate' | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths-ignore: | |
| - '.github/**' | |
| - '**/package.json' | |
| - '.yarn/versions/**' | |
| concurrency: | |
| group: ${{ github.workflow }} | |
| cancel-in-progress: false | |
| jobs: | |
| publish-rc: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set Node version | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: '.nvmrc' | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Install dependencies and publish | |
| run: yarn && yarn publish:next | |
| env: | |
| YARN_NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTOMATION_FROM_CHANCE }} | |
| - name: Branch protection OFF | |
| run: | | |
| curl --request PUT \ | |
| --url 'https://api.github.com/repos/${{ github.repository }}/branches/main/protection' \ | |
| --header 'Authorization: token ${{ secrets.PAT_CHANGE_BRANCH_PROTECTION_RULES_FROM_CHANCE }}' \ | |
| --data '{"required_status_checks":null,"enforce_admins":false,"required_pull_request_reviews":null,"restrictions":null}' | |
| - name: Commit release candidate | |
| uses: stefanzweifel/git-auto-commit-action@v5 | |
| with: | |
| commit_message: 'Publish release candidate' | |
| # https://docs.github.com/en/rest/reference/repos#update-branch-protection-preview-notices | |
| - name: Branch protection ON | |
| run: | | |
| curl --request PUT \ | |
| --url 'https://api.github.com/repos/${{ github.repository }}/branches/main/protection' \ | |
| --header 'Authorization: token ${{ secrets.PAT_CHANGE_BRANCH_PROTECTION_RULES_FROM_CHANCE }}' \ | |
| --header 'Accept: application/vnd.github.luke-cage-preview+json' \ | |
| --data '{"required_status_checks":{"strict":false,"contexts":["UI Tests","check","test"]},"enforce_admins":true,"required_pull_request_reviews":{"require_code_owner_reviews":true,"required_approving_review_count":1},"restrictions":null}' |