mirror of
https://github.com/peaceiris/actions-hugo.git
synced 2026-01-24 10:47:28 +01:00
gha: Enhance workflows (#102)
* gha: Add Pull Request to stale target * gha: Add ncc check step (Close #98 ) * src: Rename showVersion() * test: Add not to be cases * Remove old comment * gha: Add update major tag workflow (Close #97 )
This commit is contained in:
3
.github/workflows/stale.yml
vendored
3
.github/workflows/stale.yml
vendored
@@ -1,4 +1,4 @@
|
||||
name: "Close stale issues"
|
||||
name: Stale
|
||||
|
||||
on:
|
||||
schedule:
|
||||
@@ -12,5 +12,6 @@ jobs:
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
stale-issue-message: 'This issue is stale because it has been open 21 days with no activity. Remove stale label or comment or this will be closed in 7 days.'
|
||||
stale-pr-message: 'This pull request is stale because it has been open 21 days with no activity. Remove stale label or comment or this will be closed in 7 days.'
|
||||
days-before-stale: 21
|
||||
days-before-close: 7
|
||||
|
||||
5
.github/workflows/test.yml
vendored
5
.github/workflows/test.yml
vendored
@@ -45,6 +45,11 @@ jobs:
|
||||
|
||||
- run: npm test
|
||||
|
||||
- name: Check ncc
|
||||
run: |
|
||||
npm run build
|
||||
test -z "$(git status --short)"
|
||||
|
||||
- name: Upload test coverage
|
||||
uses: actions/upload-artifact@v1
|
||||
with:
|
||||
|
||||
24
.github/workflows/update-major-tag.yml
vendored
Normal file
24
.github/workflows/update-major-tag.yml
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
name: Update major tag
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
jobs:
|
||||
update:
|
||||
runs-on: ubuntu-18.04
|
||||
steps:
|
||||
|
||||
- uses: actions/checkout@v1
|
||||
|
||||
- name: Update major tag
|
||||
if: github.event.release.prerelease == false
|
||||
run: |
|
||||
git config user.name "${GITHUB_ACTOR}"
|
||||
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
|
||||
git remote set-url origin "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git"
|
||||
export TAG_NAME="${GITHUB_REF##refs/tags/}"
|
||||
export TAG_MAJOR="${TAG_NAME%%.*}"
|
||||
git tag "${TAG_MAJOR}" || git tag -d "${TAG_MAJOR}" ; git push origin ":refs/tags/${TAG_MAJOR}"
|
||||
git tag "${TAG_MAJOR}" || true
|
||||
git push --tags origin
|
||||
Reference in New Issue
Block a user