forked from demisto/content
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into devo-enh-3
- Loading branch information
Showing
3,066 changed files
with
114,677 additions
and
129,950 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
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
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
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -14,6 +14,11 @@ on: | |
description: The SDK release changes | ||
required: true | ||
type: string | ||
is_draft: | ||
description: Is draft pull request | ||
required: false | ||
type: boolean | ||
default: false | ||
|
||
permissions: | ||
contents: write | ||
|
@@ -38,7 +43,7 @@ jobs: | |
python-version: '3.10' | ||
cache: 'poetry' | ||
|
||
- name: Create brnach | ||
- name: Create branch | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Content Bot" | ||
|
@@ -49,14 +54,21 @@ jobs: | |
run: | | ||
poetry add --group dev demisto-sdk@${{inputs.release_version}} | ||
poetry lock --no-update | ||
git add . | ||
source .venv/bin/activate | ||
demisto-sdk pre-commit --no-validate --no-secrets | ||
demisto-sdk pre-commit --mode=ci | ||
git add . | ||
- name: Create pull request | ||
run: | | ||
git commit -m "poetry files" -a | ||
git push origin ${{ inputs.release_version }} | ||
gh pr create -B master -H ${{ inputs.release_version }} --title "demisto-sdk-release ${{ inputs.release_version }}" --body "${{ inputs.release_changes }}" --reviewer ${{ inputs.reviewer }} -l "docs-approved" | ||
if ${{ inputs.is_draft == true }}; then | ||
echo "creating draft release pull request" | ||
gh pr create -B master -H ${{ inputs.release_version }} --title "demisto-sdk-release ${{ inputs.release_version }}" --body "${{ inputs.release_changes }}" --reviewer ${{ inputs.reviewer }} -l "docs-approved" --draft | ||
else | ||
echo "creating release pull request" | ||
gh pr create -B master -H ${{ inputs.release_version }} --title "demisto-sdk-release ${{ inputs.release_version }}" --body "${{ inputs.release_changes }}" --reviewer ${{ inputs.reviewer }} -l "docs-approved" | ||
fi | ||
env: | ||
GH_TOKEN: ${{ secrets.CONTENTBOT_GH_ADMIN_TOKEN }} |
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.