Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
17 changes: 0 additions & 17 deletions .github/stale.yml

This file was deleted.

69 changes: 33 additions & 36 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ on:
pull_request:
branches:
- main
types:
- opened
- ready_for_review
- synchronize
- reopened
push:
branches:
- main
Expand All @@ -27,47 +32,15 @@ env:
DEBUG: ${{ inputs.debug || secrets.ACTIONS_RUNNER_DEBUG || vars.ACTIONS_RUNNER_DEBUG || secrets.ACTIONS_STEP_DEBUG || vars.ACTIONS_STEP_DEBUG || false }}

jobs:
validate:
name: Validate
if: ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && !github.event.pull_request.draft) }}
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Detect changes
uses: dorny/paths-filter@v2
id: changes
with:
filters: |
gh-workflows:
- '.github/workflows/**'
md:
- '**/*.md'

- name: actionlint
if: ${{ steps.changes.outputs.gh-workflows == 'true' }}
uses: raven-actions/actionlint@v1
with:
flags: "-ignore SC2086"

- name: Markdown Links
if: ${{ steps.changes.outputs.md == 'true' }}
uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
config-file: .github/linters/.markdown-link-check.json

dog-food:
name: Dog food
runs-on: ubuntu-latest
outputs:
repos: ${{ steps.get-repos.outputs.repos }}
count: ${{ steps.get-repos.outputs.count }}
format: ${{ steps.get-repos.outputs.format }}
steps:
- name: Debug Action
- name: Debug
if: ${{ env.DEBUG == 'true' }}
uses: raven-actions/debug@v1
with:
Expand All @@ -79,11 +52,29 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Get Repositories Action
- name: Get Repositories Action (json)
id: get-repos
uses: ./
with:
topics: "raven-actions"
topics: "raven-actions,composite-action"

- name: Get Repositories Action (flat)
id: get-repos-flat
uses: ./
with:
topics: "raven-actions,composite-action,debug"
format: flat

- name: Test flat output
run: |
echo "Total count: ${COUNT}"
echo "Format: ${FORMAT}"
echo "Repos:"
echo -e "${REPOS}"
env:
REPOS: ${{ steps.get-repos-flat.outputs.repos }}
COUNT: ${{ steps.get-repos-flat.outputs.count }}
FORMAT: ${{ steps.get-repos-flat.outputs.format }}

test-matrix:
name: Test matrix (${{ matrix.repo.name }})
Expand All @@ -100,10 +91,12 @@ jobs:
- name: Test
run: |
echo "Total count: ${COUNT}"
echo "Format: ${FORMAT}"
echo "Repo: ${REPO}"
env:
REPO: ${{ toJson(matrix.repo) }}
COUNT: ${{ needs.dog-food.outputs.count }}
FORMAT: ${{ needs.dog-food.outputs.format }}

dog-food-matrix:
name: Dog food (${{ matrix.os }})
Expand Down Expand Up @@ -132,18 +125,22 @@ jobs:
if: ${{ runner.os != 'Windows' }}
run: |
echo "Total count: ${COUNT}"
echo "Format: ${FORMAT}"
echo "Repos: ${REPOS}"
shell: bash
env:
REPOS: ${{ toJson(steps.get-repos.outputs.repos) }}
COUNT: ${{ steps.get-repos.outputs.count }}
FORMAT: ${{ steps.get-repos.outputs.format }}

- name: Test
if: ${{ runner.os == 'Windows' }}
run: |
Write-Output "Total count: ${env:COUNT}"
Write-Output "Format: ${env:FORMAT}"
Write-Output "Repos: ${env:REPOS}"
shell: pwsh
env:
REPOS: ${{ toJson(steps.get-repos.outputs.repos) }}
COUNT: ${{ steps.get-repos.outputs.count }}
FORMAT: ${{ steps.get-repos.outputs.format }}
21 changes: 21 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: Linter

on:
pull_request:
branches:
- main
types:
- opened
- ready_for_review
- synchronize
- reopened
push:
branches:
- main

jobs:
linter:
name: Linter
uses: raven-actions/.workflows/.github/workflows/__linter.yml@main
secrets: inherit
33 changes: 2 additions & 31 deletions .github/workflows/release-draft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,9 @@ on:
push:
branches:
- main
workflow_dispatch:
# pull_request:
# # Only following types are handled by the action, but one can default to all as well

jobs:
draft-release:
if: ${{ github.repository_owner == 'raven-actions' }}
name: Draft Release
permissions:
contents: write
pull-requests: read
runs-on: ubuntu-latest
steps:
- name: Get GitHub App Token
uses: wow-actions/use-app-token@v2
id: get-token
with:
app_id: ${{ secrets.ORG_BOT_APP_ID }}
private_key: ${{ secrets.ORG_BOT_PRIVATE_KEY }}
fallback: ${{ github.token }}

- name: Run Release Drafter
uses: release-drafter/release-drafter@v5
id: release-drafter
with:
prerelease: true
env:
GITHUB_TOKEN: ${{ steps.get-token.outputs.BOT_TOKEN }}

- name: Get Release URL
run: |
echo "${RELEASE_URL}"
echo "${RELEASE_URL}" >> $GITHUB_STEP_SUMMARY
env:
RELEASE_URL: ${{ steps.release-drafter.outputs.html_url }}
uses: raven-actions/.workflows/.github/workflows/__release-draft.yml@main
secrets: inherit
36 changes: 6 additions & 30 deletions .github/workflows/release-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,10 @@ on:
description: Tag name that the major tag will point to
required: true

env:
TAG_NAME: ${{ github.event.inputs.tag-name || github.event.release.tag_name }}

jobs:
gh-release-update:
name: GitHub Release
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Get GitHub App Token
uses: wow-actions/use-app-token@v2
id: get-token
with:
app_id: ${{ secrets.ORG_BOT_APP_ID }}
private_key: ${{ secrets.ORG_BOT_PRIVATE_KEY }}
fallback: ${{ github.token }}

- name: Update release to the latest
id: gh-release
uses: softprops/action-gh-release@v1
with:
prerelease: false
token: ${{ steps.get-token.outputs.BOT_TOKEN }}

- name: Update the major tag to include the ${{ env.TAG_NAME }} changes
id: update-major-tag
uses: actions/[email protected]
with:
source-tag: ${{ env.TAG_NAME }}
token: ${{ steps.get-token.outputs.BOT_TOKEN }}
publish-release:
name: Publish Release
uses: raven-actions/.workflows/.github/workflows/__release-publish.yml@main
secrets: inherit
with:
tag-name: ${{ github.event.inputs.tag-name || github.event.release.tag_name }}
18 changes: 9 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ repos:
- "--no-sort-keys"
exclude: "package-lock.json|.vscode/.*"
- id: end-of-file-fixer
- id: no-commit-to-branch
# - id: no-commit-to-branch
- id: check-executables-have-shebangs
- id: check-vcs-permalinks

Expand All @@ -44,12 +44,12 @@ repos:
- id: gitleaks
args:
- --config
- ".github/linters/.gitleak.toml"
- ".github/linters/.gitleaks.toml"

- repo: https://github.com/rhysd/actionlint
rev: v1.6.24
hooks:
- id: actionlint
args:
- "-ignore"
- "SC2086"
# - repo: https://github.com/rhysd/actionlint
# rev: v1.6.24
# hooks:
# - id: actionlint
# args:
# - "-ignore"
# - "SC2086"
Loading