Python conversion of maintenance commands (#2739)
* updating atomics count in README.md [ci skip] * converting python * rename * fix path * minor refactor --------- Co-authored-by: publish bot <opensource@redcanary.com>
This commit is contained in:
@@ -2,7 +2,7 @@ name: generate-svg-counter
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ["master"]
|
||||
branches: [ "master" ]
|
||||
|
||||
jobs:
|
||||
generate-counter:
|
||||
@@ -15,18 +15,20 @@ jobs:
|
||||
run: pipx install poetry
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.11.2'
|
||||
python-version: '3.11.2'
|
||||
cache: 'poetry'
|
||||
- name: Install dependencies
|
||||
run: poetry install --no-interaction --no-root
|
||||
- name: Generate shields.io URL
|
||||
run: poetry run python bin/generate_counter.py -f atomics/
|
||||
run: poetry run python atomic_red_team/runner.py generate-counter
|
||||
id: counter
|
||||
- name: Update README
|
||||
run: |
|
||||
echo ${{ steps.counter.outputs.result }}
|
||||
sed -i "s|https://img.shields.io/badge/Atomics-.*-flat.svg|${{ steps.counter.outputs.result }}|" README.md
|
||||
shell: bash
|
||||
- name: Generate and commit unique GUIDs for each atomic test
|
||||
run: poetry run python atomic_red_team/runner.py generate-guids
|
||||
- name: update github with new site
|
||||
run: |
|
||||
# configure git to prep for commit
|
||||
@@ -34,7 +36,7 @@ jobs:
|
||||
git config user.name "publish bot"
|
||||
git config --global push.default simple
|
||||
git add README.md
|
||||
git commit --allow-empty -m "updating atomics count in README.md [ci skip]"
|
||||
git commit --allow-empty -m "updating atomics count and guids [ci skip]"
|
||||
# push quietly to prevent showing the token in log
|
||||
# no need to provide any credentials
|
||||
git push --force
|
||||
@@ -1,7 +1,7 @@
|
||||
name: generate-docs
|
||||
on:
|
||||
push:
|
||||
branches: ["master"]
|
||||
branches: [ "master" ]
|
||||
|
||||
jobs:
|
||||
generate-docs:
|
||||
@@ -15,29 +15,7 @@ jobs:
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: 2.7
|
||||
bundler-cache: true
|
||||
|
||||
- name: Generate and commit unique GUIDs for each atomic test
|
||||
run: |
|
||||
bin/generate-guids.rb
|
||||
|
||||
echo ""
|
||||
echo ""
|
||||
git status
|
||||
echo ""
|
||||
echo ""
|
||||
git diff-index HEAD --
|
||||
|
||||
if git diff-index --quiet HEAD -- ; then
|
||||
echo "Not committing GUID changes because there are no changes"
|
||||
else
|
||||
git config credential.helper 'cache --timeout=120'
|
||||
git config user.email "opensource@redcanary.com"
|
||||
git config user.name "Atomic Red Team GUID generator"
|
||||
git add atomics
|
||||
git commit -am "Generate GUIDs from job=$GITHUB_JOB branch=$GITHUB_REF_NAME [skip ci]"
|
||||
git push origin $GITHUB_REF_NAME -f
|
||||
fi
|
||||
bundler-cache: true
|
||||
|
||||
- name: generate markdown docs for atomics
|
||||
run: |
|
||||
|
||||
@@ -24,8 +24,7 @@ jobs:
|
||||
run: poetry install --no-interaction --no-root
|
||||
|
||||
- name: validate the format of atomics tests against the spec
|
||||
run: |
|
||||
poetry run python bin/validate/validate.py
|
||||
run: poetry run python atomic_red_team/runner.py validate
|
||||
|
||||
upload:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -62,7 +61,7 @@ jobs:
|
||||
run: poetry install --no-interaction --no-root
|
||||
- name: save labels and reviewers into a file.
|
||||
run: |
|
||||
poetry run python bin/generate_labels.py -t ${{ secrets.GITHUB_TOKEN }} -pr '${{steps.get_pr_number.outputs.result}}'
|
||||
poetry run python atomic_red_team/runner.py generate-labels --pr '${{steps.get_pr_number.outputs.result}}' --token ${{ secrets.GITHUB_TOKEN }}
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: labels.json
|
||||
|
||||
Reference in New Issue
Block a user