fix(tools): update autoclose workflow (#44917)
This commit is contained in:
8
.github/workflows/autoclose.yml
vendored
8
.github/workflows/autoclose.yml
vendored
@ -14,6 +14,11 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
github-token: ${{secrets.GITHUB_TOKEN}}
|
github-token: ${{secrets.GITHUB_TOKEN}}
|
||||||
script: |
|
script: |
|
||||||
|
const patches = [
|
||||||
|
"@@ -63,7 +63,6 @@ $RECYCLE.BIN/\n # Icon must end with two \\r\n Icon\n \n-\n # Thumbnails\n ._*\n "
|
||||||
|
"@@ -63,7 +63,6 @@ $RECYCLE.BIN/\n # Icon must end with two \\r\n Icon\n \n-\n # Thumbnails\n ._*\n \n@@ -165,7 +164,6 @@ config/curriculum.json\n config/i18n/all-langs.js\n config/certification-settings.js\n \n-\n ### vim ###\n # Swap\n [._]*.s[a-v][a-z]",
|
||||||
|
"@@ -165,7 +165,6 @@ config/curriculum.json\n config/i18n/all-langs.js\n config/certification-settings.js\n \n-\n ### vim ###\n # Swap\n [._]*.s[a-v][a-z]"
|
||||||
|
];
|
||||||
const files = await github.rest.pulls.listFiles({
|
const files = await github.rest.pulls.listFiles({
|
||||||
owner: context.payload.repository.owner.login,
|
owner: context.payload.repository.owner.login,
|
||||||
repo: context.payload.repository.name,
|
repo: context.payload.repository.name,
|
||||||
@ -22,8 +27,7 @@ jobs:
|
|||||||
if (
|
if (
|
||||||
files.data.length === 1 &&
|
files.data.length === 1 &&
|
||||||
files.data[0].filename === ".gitignore" &&
|
files.data[0].filename === ".gitignore" &&
|
||||||
files.data[0].patch ===
|
patches.includes(files.data[0].patch)
|
||||||
"@@ -63,7 +63,6 @@ $RECYCLE.BIN/\n # Icon must end with two \\r\n Icon\n \n-\n # Thumbnails\n ._*\n "
|
|
||||||
) {
|
) {
|
||||||
core.setFailed("Invalid PR detected.");
|
core.setFailed("Invalid PR detected.");
|
||||||
github.rest.issues.createComment({
|
github.rest.issues.createComment({
|
||||||
|
Reference in New Issue
Block a user