Refresh metadata and workflows

This commit is contained in:
yeasy
2026-05-18 07:38:58 -07:00
parent 5650315cb4
commit 0b8f6e9b60
11 changed files with 102 additions and 30 deletions
+9 -6
View File
@@ -24,13 +24,16 @@ jobs:
sudo apt-get update
sudo apt-get install -y fonts-noto-cjk fonts-noto-cjk-extra
- name: Install mdpress (latest)
- name: Install mdpress 0.7.10
env:
MDPRESS_VERSION: "0.7.10"
MDPRESS_SHA256: "17e53e455996940bbbce64c69c43b3fb543f1501e03b74cf0434074efebd2db4"
run: |
LATEST_TAG=$(curl -fsSL -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ github.token }}" https://api.github.com/repos/yeasy/mdpress/releases/latest | jq -r .tag_name)
VERSION="${LATEST_TAG#v}"
echo "Installing mdpress $VERSION"
curl -fsSL "https://github.com/yeasy/mdPress/releases/download/$LATEST_TAG/mdpress_${VERSION}_linux_amd64.tar.gz" -o /tmp/mdpress.tar.gz
tar xzf /tmp/mdpress.tar.gz -C /tmp mdpress
archive="/tmp/mdpress_${MDPRESS_VERSION}_linux_amd64.tar.gz"
echo "Installing mdpress ${MDPRESS_VERSION}"
curl -fsSL "https://github.com/yeasy/mdPress/releases/download/v${MDPRESS_VERSION}/mdpress_${MDPRESS_VERSION}_linux_amd64.tar.gz" -o "$archive"
echo "${MDPRESS_SHA256} $archive" | sha256sum -c -
tar xzf "$archive" -C /tmp mdpress
sudo mv /tmp/mdpress /usr/local/bin/
mdpress --version
+10 -7
View File
@@ -24,17 +24,20 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y fonts-noto-cjk fonts-noto-cjk-extra
- name: Install mdpress (latest)
- name: Install mdpress 0.7.10
env:
MDPRESS_VERSION: "0.7.10"
MDPRESS_SHA256: "17e53e455996940bbbce64c69c43b3fb543f1501e03b74cf0434074efebd2db4"
run: |
LATEST_TAG=$(curl -fsSL -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ github.token }}" https://api.github.com/repos/yeasy/mdpress/releases/latest | jq -r .tag_name)
VERSION="${LATEST_TAG#v}"
echo "Installing mdpress $VERSION"
curl -fsSL "https://github.com/yeasy/mdPress/releases/download/$LATEST_TAG/mdpress_${VERSION}_linux_amd64.tar.gz" -o mdpress.tar.gz
tar xzf mdpress.tar.gz
archive="/tmp/mdpress_${MDPRESS_VERSION}_linux_amd64.tar.gz"
echo "Installing mdpress ${MDPRESS_VERSION}"
curl -fsSL "https://github.com/yeasy/mdPress/releases/download/v${MDPRESS_VERSION}/mdpress_${MDPRESS_VERSION}_linux_amd64.tar.gz" -o "$archive"
echo "${MDPRESS_SHA256} $archive" | sha256sum -c -
tar xzf "$archive"
sudo mv mdpress /usr/local/bin/
mdpress --version
- name: Build site
run: mdpress build --format site
run: npm run build
- name: Build PDF
run: mdpress build --format pdf --output docker_practice.pdf
- name: Upload PDF as artifact
+25 -3
View File
@@ -4,6 +4,7 @@ on: pull_request
permissions:
contents: write
pull-requests: write
checks: read
jobs:
dependabot:
@@ -12,15 +13,36 @@ jobs:
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v3
uses: dependabot/fetch-metadata@25dd0e34f4fe68f24cc83900b1fe3fe149efef98 # v3
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Approve a PR
- name: Confirm required checks are configured
if: >
steps.metadata.outputs.package-ecosystem == 'github_actions' &&
contains(fromJSON('["version-update:semver-patch","version-update:semver-minor"]'), steps.metadata.outputs.update-type)
run: |
REQUIRED=$(gh api "repos/${GITHUB_REPOSITORY}/branches/${{ github.event.pull_request.base.ref }}/protection/required_status_checks" --jq '((.contexts // []) | length) + ((.checks // []) | length)' 2>/dev/null || echo 0)
if [ "$REQUIRED" -eq 0 ]; then
echo "No required status checks configured on the base branch; refusing Dependabot auto-merge."
exit 1
fi
env:
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Approve low-risk Dependabot PR
if: >
steps.metadata.outputs.package-ecosystem == 'github_actions' &&
contains(fromJSON('["version-update:semver-patch","version-update:semver-minor"]'), steps.metadata.outputs.update-type)
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Enable auto-merge for Dependabot PRs
- name: Enable auto-merge for low-risk Dependabot PRs
if: >
steps.metadata.outputs.package-ecosystem == 'github_actions' &&
contains(fromJSON('["version-update:semver-patch","version-update:semver-minor"]'), steps.metadata.outputs.update-type)
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
+9 -6
View File
@@ -31,13 +31,16 @@ jobs:
sudo apt-get update
sudo apt-get install -y fonts-noto-cjk fonts-noto-cjk-extra
- name: Install mdpress (latest)
- name: Install mdpress 0.7.10
env:
MDPRESS_VERSION: "0.7.10"
MDPRESS_SHA256: "17e53e455996940bbbce64c69c43b3fb543f1501e03b74cf0434074efebd2db4"
run: |
LATEST_TAG=$(curl -fsSL -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ github.token }}" https://api.github.com/repos/yeasy/mdpress/releases/latest | jq -r .tag_name)
VERSION="${LATEST_TAG#v}"
echo "Installing mdpress $VERSION"
curl -fsSL "https://github.com/yeasy/mdPress/releases/download/$LATEST_TAG/mdpress_${VERSION}_linux_amd64.tar.gz" -o /tmp/mdpress.tar.gz
tar xzf /tmp/mdpress.tar.gz -C /tmp mdpress
archive="/tmp/mdpress_${MDPRESS_VERSION}_linux_amd64.tar.gz"
echo "Installing mdpress ${MDPRESS_VERSION}"
curl -fsSL "https://github.com/yeasy/mdPress/releases/download/v${MDPRESS_VERSION}/mdpress_${MDPRESS_VERSION}_linux_amd64.tar.gz" -o "$archive"
echo "${MDPRESS_SHA256} $archive" | sha256sum -c -
tar xzf "$archive" -C /tmp mdpress
sudo mv /tmp/mdpress /usr/local/bin/
mdpress --version