Moduli merging workflow #78
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
--- | |
name: Moduli merging workflow | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "30 4 * * */6" | |
permissions: | |
contents: read | |
jobs: | |
Generate: | |
runs-on: ubuntu-latest | |
permissions: | |
actions: read | |
contents: write | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 | |
with: | |
egress-policy: audit | |
- name: Set current date as env variable | |
run: echo CURRENT_DATE=$(date +'%Y%m%d') >> $GITHUB_ENV | |
- name: Checkout repository | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
with: | |
ref: ${{ github.head_ref }} | |
- name: Generate moduli file | |
run: | | |
set -eu -o pipefail | |
curl -fsSL "https://raw.githubusercontent.com/openssh/openssh-portable/master/moduli" | grep -v '^#' > /tmp/moduli.tmp | |
curl -fsSL "https://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/usr.bin/ssh/moduli-gen/moduli.{3072,4096,6144,7680,8192}" >> /tmp/moduli.tmp | |
echo "# Generated at ${{ env.CURRENT_DATE }} from ${{ github.repositoryUrl }}" > ./moduli | |
echo "# Timestamp Type Tests Trials Size Generator Modulus" >> ./moduli | |
awk '$5 >= 3071' /tmp/moduli.tmp | grep -vE '^$|#'| sort -u >> ./moduli | |
rm -v /tmp/moduli.tmp | |
head -n5 ./moduli | |
- name: Upload moduli artifact | |
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 | |
with: | |
name: moduli | |
path: ./moduli | |
- uses: stefanzweifel/git-auto-commit-action@8621497c8c39c72f3e2a999a26b4ca1b5058a842 # v5.0.1 | |
with: | |
commit_message: Updated moduli file - ${{ env.CURRENT_DATE }} |