Fix duplicate semver minor
blocks (#7269)
* chore(action): fix duplicate blocks * chore(action): fix block logic
This commit is contained in:
parent
5156c4f90e
commit
408be72d1d
1 changed files with 11 additions and 12 deletions
23
.github/workflows/check-merge.yml
vendored
23
.github/workflows/check-merge.yml
vendored
|
@ -12,7 +12,7 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Check if there is already a block on this PR
|
- name: Check if there is already a block on this PR
|
||||||
id: set-blocks
|
id: blocked
|
||||||
uses: actions/github-script@v6
|
uses: actions/github-script@v6
|
||||||
env:
|
env:
|
||||||
issue_number: ${{ github.event.number }}
|
issue_number: ${{ github.event.number }}
|
||||||
|
@ -23,31 +23,31 @@ jobs:
|
||||||
repo: context.repo.repo,
|
repo: context.repo.repo,
|
||||||
pull_number: process.env.issue_number,
|
pull_number: process.env.issue_number,
|
||||||
});
|
});
|
||||||
console.log(reviews);
|
|
||||||
for (const review of reviews) {
|
for (const review of reviews) {
|
||||||
if (review.user.id === 41898282 && review.state === 'CHANGES_REQUESTED') {
|
if (review.user.login === 'github-actions[bot]' && review.state === 'CHANGES_REQUESTED') {
|
||||||
return 'block';
|
return 'true'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return '';
|
return 'false'
|
||||||
result-encoding: string
|
result-encoding: string
|
||||||
|
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
if: steps.set-blocks.outputs.blocks == ''
|
if: steps.blocked.outputs.result != 'true'
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Get changed files in the .changeset folder
|
- name: Get changed files in the .changeset folder
|
||||||
id: changed-files
|
id: changed-files
|
||||||
uses: tj-actions/changed-files@v35
|
uses: tj-actions/changed-files@v35
|
||||||
if: steps.set-blocks.outputs.blocks == ''
|
if: steps.blocked.outputs.result != 'true'
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
.changeset/**/*.md
|
.changeset/**/*.md
|
||||||
|
|
||||||
- name: Check if any changesets contain minor changes
|
- name: Check if any changesets contain minor changes
|
||||||
id: find-blockers
|
id: minor
|
||||||
if: steps.set-blocks.outputs.blocks == ''
|
if: steps.blocked.outputs.result != 'true'
|
||||||
run: |
|
run: |
|
||||||
echo "Checking for changesets marked as minor"
|
echo "Checking for changesets marked as minor"
|
||||||
echo '::set-output name=found::false'
|
echo '::set-output name=found::false'
|
||||||
|
@ -60,7 +60,7 @@ jobs:
|
||||||
|
|
||||||
- name: Add label
|
- name: Add label
|
||||||
uses: actions/github-script@v6
|
uses: actions/github-script@v6
|
||||||
if: steps.find-blockers.outputs.found == 'true'
|
if: steps.minor.outputs.found == 'true'
|
||||||
env:
|
env:
|
||||||
issue_number: ${{ github.event.number }}
|
issue_number: ${{ github.event.number }}
|
||||||
with:
|
with:
|
||||||
|
@ -74,7 +74,7 @@ jobs:
|
||||||
|
|
||||||
- name: Change PR Status
|
- name: Change PR Status
|
||||||
uses: actions/github-script@v6
|
uses: actions/github-script@v6
|
||||||
if: steps.find-blockers.outputs.found == 'true'
|
if: steps.minor.outputs.found == 'true'
|
||||||
env:
|
env:
|
||||||
issue_number: ${{ github.event.number }}
|
issue_number: ${{ github.event.number }}
|
||||||
with:
|
with:
|
||||||
|
@ -86,4 +86,3 @@ jobs:
|
||||||
event: 'REQUEST_CHANGES',
|
event: 'REQUEST_CHANGES',
|
||||||
body: 'This PR is blocked because it contains a `minor` changeset. A reviewer will merge this at the next release if approved.'
|
body: 'This PR is blocked because it contains a `minor` changeset. A reviewer will merge this at the next release if approved.'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue