forked from demisto/content
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'demisto:master' into gem_test
- Loading branch information
Showing
1,879 changed files
with
62,556 additions
and
15,209 deletions.
There are no files selected for viewing
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
Validating CODEOWNERS rules …
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Check nightly-ok label | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize, labeled, unlabeled] | ||
|
||
jobs: | ||
check_label: | ||
runs-on: ubuntu-latest | ||
if: github.repository == 'demisto/content' && github.event.pull_request.head.repo.fork == false | ||
|
||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Check if files under .gitlab directory are changed | ||
id: check-changes | ||
run: | | ||
CHANGED_FILES=$(git diff --name-only origin/master origin/${{ github.head_ref || github.ref_name }}) | ||
echo "All changed files:" | ||
echo "${CHANGED_FILES}" | ||
GITLAB_CHANGED_FILES=$( [[ $CHANGED_FILES == *".gitlab/ci"* ]] && echo true || echo false) | ||
echo "Files in the .gitlab folder have changed: ${GITLAB_CHANGED_FILES}" | ||
echo "gitlab_changed_files=$GITLAB_CHANGED_FILES" >> $GITHUB_OUTPUT | ||
if [[ $GITLAB_CHANGED_FILES == true ]]; then | ||
echo 'Files under .gitlab folder has changed, Will check if the PR has the `nightly-ok` label.' | ||
else | ||
echo 'Files in the .gitlab folder have not been changed.' | ||
fi | ||
- name: Check if PR has the nightly-ok label | ||
uses: actions/github-script@v7 | ||
id: check-label | ||
with: | ||
script: | | ||
const gitlabChangedFiles = ${{ steps.check-changes.outputs.gitlab_changed_files }}; | ||
if(gitlabChangedFiles) { | ||
console.log('Files under .gitlab folder has changed, Will check if the PR has the `nightly-ok` label.'); | ||
const labels = context.payload.pull_request.labels.map(label => label.name); | ||
const hasLabel = labels.includes('nightly-ok'); | ||
if (hasLabel) { | ||
console.log('All good, the PR has the `nightly-ok` label.'); | ||
} else { | ||
console.log('PR does not have the `nightly-ok` label. It is required when changing files under the `.gitlab` directory. Please run nightly using the Utils/gitlab_triggers/trigger_content_nightly_build.sh script, check that succeeded, and add the `nightly-ok` label'); | ||
process.exit(1); // Exit with failure status if label is missing | ||
} | ||
} else { | ||
console.log('Files in the .gitlab folder have not been changed.'); | ||
} |
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
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
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
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
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
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
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
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
Oops, something went wrong.