Skip to content

Commit

Permalink
Manual testing
Browse files Browse the repository at this point in the history
  • Loading branch information
shashank-elastic committed Jul 1, 2024
1 parent 2843e23 commit 2df7dc6
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions .github/workflows/kibana-mitre-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,26 @@ jobs:

- name: Extract version from file name
id: extract_version
if: steps.changed-attack-files.outputs.any_changed == 'true'
if: steps.changed-attack-files.outputs.added_files == 'true'
env:
ALL_CHANGED_FILES: ${{ steps.changed-attack-files.outputs.all_changed_files }}
ADDED_FILE: ${{ steps.changed-attack-files.outputs.added_files }}
run: |
for file in ${ALL_CHANGED_FILES}; do
VERSION=$(echo $file | grep -o 'v[^json]*')
echo "::set-output name=version::$VERSION"
done
VERSION=$(echo $ADDED_FILE[0] | grep -o 'v[^json]*')
echo "::set-output name=version::$VERSION"
- name: Create issue in elastic/kibana repository
run: |
ISSUE_TITLE="Update MITRE ATT&CK to ${{ steps.extract_version.outputs.version }}"
ISSUE_BODY="The detection rules MITRE ATT&CK version has been updated to ${{ steps.extract_version.outputs.version }}. Please update the MITRE ATT&CK version in Kibana accordingly."
echo "Creating issue with title: $ISSUE_TITLE"
echo "Creating issue with body: $ISSUE_BODY"
curl -X POST \
-H "Authorization: token ${{ secrets.PROTECTIONS_MACHINE_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/elastic/detection-rules/issues \
-d '{
"title": "'"$ISSUE_TITLE"'",
"body": "'"$ISSUE_BODY"'"
}'
env:
GITHUB_TOKEN: ${{ secrets.PROTECTIONS_MACHINE_TOKEN }}

0 comments on commit 2df7dc6

Please sign in to comment.