Skip to content

Commit

Permalink
Acquire Lock - switched from main to aquire-lock branch
Browse files Browse the repository at this point in the history
  • Loading branch information
vradulescu-bd committed Nov 20, 2024
1 parent 7e443d2 commit 42de58b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 24 deletions.
34 changes: 10 additions & 24 deletions .github/workflows/accept-baseline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- name: Verify Approvals
run: |
APPROVALS=$(gh pr view ${{ github.event.pull_request.number }} --json reviews --jq '[.reviews[] | select(.state=="APPROVED")] | length')
if [[ "$APPROVALS" -lt 2 ]]; then
if [[ "$APPROVALS" -lt 1 ]]; then
echo "Not enough approvals. Exiting."
exit 1
fi
Expand Down Expand Up @@ -127,41 +127,27 @@ jobs:
env:
GI_KEY: ${{ secrets.GI_KEY }}

auto-merge:
needs: update-baselines
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Release Lock
if: success()
run: |
git config user.name "github-actions"
git config user.email "[email protected]"
git pull origin aquire-lock
git rm .baseline-lock
git commit -m "Release lock for baseline update [skip husky]"
git push origin aquire-lock
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Update Snapshots Check Status
if: success()
run: |
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/bitdefender/www-landing-pages/statuses/${{ github.event.pull_request.head.sha }} \
-d '{
"state":"success",
"target_url":"https://github.com/bitdefender/www-landing-pages/actions/runs/${{ github.run_id }}","description":"The build succeeded!","context":"Run Tests and Snapshots / snapshots-tests (pull_request)"}'

auto-merge:
needs: update-baselines
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Auto-Merge PR
if: success()
run: gh pr merge ${{ github.event.pull_request.number }} --squash --admin
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
lint:
needs: setup-nodejs
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' }}
steps:
- uses: actions/checkout@v3
- run: npm install
Expand All @@ -30,6 +31,7 @@ jobs:
unit-tests:
needs: setup-nodejs
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' }}
steps:
- uses: actions/checkout@v3
- run: npm install
Expand Down

0 comments on commit 42de58b

Please sign in to comment.