mirror of
https://github.com/buildplan/du_setup.git
synced 2025-12-29 16:14:59 +00:00
Update checksum.yml
This commit is contained in:
37
.github/workflows/checksum.yml
vendored
37
.github/workflows/checksum.yml
vendored
@@ -1,41 +1,21 @@
|
|||||||
name: Generate & Attach SHA256 Checksum
|
name: Generate SHA256 Checksum
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
releases: write
|
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [main]
|
branches: [main]
|
||||||
release:
|
|
||||||
types: [created, published]
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
generate-sha256:
|
generate-sha256:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Repository
|
- name: Checkout Repo
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Check Script Existence
|
- name: Generate SHA256 for script
|
||||||
run: |
|
|
||||||
if [ ! -f setup_harden_debian_ubuntu.sh ]; then
|
|
||||||
echo "Error: setup_harden_debian_ubuntu.sh not found in repository root."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Clean Existing Checksum
|
|
||||||
if: github.event_name == 'release'
|
|
||||||
run: |
|
|
||||||
rm -f setup_harden_debian_ubuntu.sh.sha256
|
|
||||||
|
|
||||||
- name: Generate SHA256
|
|
||||||
run: |
|
run: |
|
||||||
sha256sum setup_harden_debian_ubuntu.sh > setup_harden_debian_ubuntu.sh.sha256
|
sha256sum setup_harden_debian_ubuntu.sh > setup_harden_debian_ubuntu.sh.sha256
|
||||||
echo "Generated checksum: $(cat setup_harden_debian_ubuntu.sh.sha256)"
|
|
||||||
|
|
||||||
- name: Commit SHA256 (only on push to main)
|
- name: Commit & Push SHA256 File
|
||||||
if: github.event_name == 'push'
|
|
||||||
run: |
|
run: |
|
||||||
git config user.name "github-actions[bot]"
|
git config user.name "github-actions[bot]"
|
||||||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||||
@@ -44,12 +24,3 @@ jobs:
|
|||||||
git push
|
git push
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Upload SHA256 to GitHub Release
|
|
||||||
if: github.event_name == 'release'
|
|
||||||
uses: softprops/action-gh-release@v1
|
|
||||||
with:
|
|
||||||
files: setup_harden_debian_ubuntu.sh.sha256
|
|
||||||
tag_name: ${{ github.event.release.tag_name }}
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user