⬆️ Bump react-native from 0.72.4 to 0.74.2 #70
Workflow file for this run
This file contains 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: Tests for merging a PR on main | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 16 | |
- name: Install dependencies | |
run: yarn install | |
- name: Run tests | |
id: test | |
run: yarn test | |
- name: Add label based on test results | |
if: always() | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
if [[ ${{ steps.test.outcome }} == 'success' ]]; then | |
LABEL_TO_ADD='ci-passing' | |
LABEL_TO_REMOVE='ci-failing' | |
else | |
LABEL_TO_ADD='ci-failing' | |
LABEL_TO_REMOVE='ci-passing' | |
fi | |
ISSUE_NUMBER=$(echo "${{ github.event.pull_request.url }}" | awk -F/ '{print $NF}') | |
# Remove the opposite label if it exists | |
curl -L \ | |
-X DELETE \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "Authorization: Bearer $GITHUB_TOKEN" \ | |
-H "X-GitHub-Api-Version: 2022-11-28" \ | |
"https://api.github.com/repos/${{ github.repository }}/issues/$ISSUE_NUMBER/labels/$LABEL_TO_REMOVE" | |
# Add the desired label | |
curl -L \ | |
-X POST \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "Authorization: Bearer $GITHUB_TOKEN" \ | |
-H "X-GitHub-Api-Version: 2022-11-28" \ | |
"https://api.github.com/repos/${{ github.repository }}/issues/$ISSUE_NUMBER/labels" \ | |
-d "{\"labels\":[\"$LABEL_TO_ADD\"]}" |