mirror of
https://github.com/buildplan/du_setup.git
synced 2025-12-29 16:14:59 +00:00
Add combined SHA256 GitHub Action
This commit is contained in:
37
.github/workflows/checksum.yml
vendored
Normal file
37
.github/workflows/checksum.yml
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
name: Generate & Attach SHA256 Checksum
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
jobs:
|
||||
generate-sha256:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Generate SHA256
|
||||
run: |
|
||||
sha256sum setup_harden_debian_ubuntu.sh > setup_harden_debian_ubuntu.sh.sha256
|
||||
|
||||
- name: Commit SHA256 (only on push to main)
|
||||
if: github.event_name == 'push'
|
||||
run: |
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
git add setup_harden_debian_ubuntu.sh.sha256
|
||||
git commit -m "Auto-update SHA256 checksum"
|
||||
git push
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Upload SHA256 to GitHub Release (only on release)
|
||||
if: github.event_name == 'release'
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
files: setup_harden_debian_ubuntu.sh.sha256
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
Reference in New Issue
Block a user