Adds stale issue management and refines CI workflows

Introduces a configuration file for automatic management of stale issues,
allowing better maintenance of the repository. Refines continuous integration
workflows to include dependency review and release processes directly within the
CI pipeline, improving efficiency and reducing redundancy by combining
previously separate workflows.

Updates branches and tags trigger configuration for CI workflows to ensure
consistency in branch protection and deployment practices.

Ensures CodeQL analysis setup aligns with current repository language use
to enhance security scanning procedures.
This commit is contained in:
2025-05-24 21:45:08 +02:00
parent bb37ebdfea
commit 8ba48d2248
9 changed files with 227 additions and 104 deletions

View File

@ -29,7 +29,7 @@ body:
value: |
1.
2.
3.
3.
validations:
required: true

67
.github/stale.yml vendored Normal file
View File

@ -0,0 +1,67 @@
# Configuration for probot-stale - https://github.com/probot/stale
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 60
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 14
# Issues with these labels will never be considered stale
exemptLabels:
- pinned
- security
- bug
- enhancement
- documentation
- "in progress"
# Label to use when marking an issue as stale
staleLabel: stale
# Comment to post when marking an issue as stale
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed in 14 days if no further activity occurs.
Thank you for your contributions to Articulate Rise Parser!
# Comment to post when closing a stale issue
closeComment: >
This issue has been automatically closed due to inactivity.
Feel free to reopen if this is still relevant.
# Limit to only specific repos (optional)
# only:
# - repo1
# - repo2
# Limit the number of actions per hour, from 1-30. Default is 30
limitPerRun: 30
# Set to true to ignore issues in a project (defaults to false)
exemptProjects: false
# Set to true to ignore issues in a milestone (defaults to false)
exemptMilestones: true
# Set to true to ignore issues with an assignee (defaults to false)
exemptAssignees: true
# Label to use when marking a pull request as stale
stalePrLabel: stale-pr
# Comment to post when marking a pull request as stale
markPrComment: >
This pull request has been automatically marked as stale because it has not had
recent activity. It will be closed in 14 days if no further activity occurs.
Thank you for your contributions to Articulate Rise Parser!
# Comment to post when closing a stale pull request
closePrComment: >
This pull request has been automatically closed due to inactivity.
Feel free to reopen if you want to continue working on this.
# Limit to only `issues` or `pulls` (optional)
# only: issues
# Set to true to ignore PRs with the WIP label or title prefix (defaults to false)
exemptWIP: true

View File

@ -2,12 +2,15 @@ name: CI
on:
push:
branches: [master, develop]
branches: [ "master", "develop" ]
tags:
- "v*.*.*"
pull_request:
branches: [master, develop]
branches: [ "master", "develop" ]
jobs:
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
@ -49,11 +52,73 @@ jobs:
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: Go ${{ matrix.go }}
slug: kjanat/articulate-parser
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
flags: Go ${{ matrix.go }}
token: ${{ secrets.CODECOV_TOKEN }}
dependency-review:
name: Dependency Review
runs-on: ubuntu-latest
permissions:
contents: read
if: github.event_name == 'pull_request'
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v4
- name: 'Dependency Review'
uses: actions/dependency-review-action@v4
with:
fail-on-severity: moderate
comment-summary-in-pr: always
# # Use comma-separated names to pass list arguments:
# deny-licenses: LGPL-2.0, BSD-2-Clause
release:
name: Release
runs-on: ubuntu-latest
if: github.ref_type == 'tag'
permissions:
contents: write
needs: [ "test" ]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
check-latest: true
- name: Run tests
run: go test -v ./...
- name: Build binaries
run: |
# Build for different platforms
OS = ["darwin", "freebsd", "linux", "windows"]
ARCH = ["amd64", "arm64"]
for os in OS:
for arch in ARCH:
GOOS=$os GOARCH=$arch go build -o articulate-parser-$os-$arch main.go
- name: Create Release
uses: softprops/action-gh-release@v2
with:
files: articulate-parser-*
generate_release_notes: true
draft: false
prerelease: ${{ startsWith(github.ref, 'refs/tags/v0.') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -1,41 +1,100 @@
name: CodeQL
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"
on:
workflow_call:
# push:
# branches: [master, develop]
# pull_request:
# branches: [master]
# schedule:
# - cron: '30 1 * * 0'
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
schedule:
- cron: '44 16 * * 6'
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
name: Analyze (${{ matrix.language }})
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners (GitHub.com only)
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
permissions:
# required for all workflows
security-events: write
# required to fetch internal or private CodeQL packs
packages: read
# only required for workflows in private repositories
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: ['go']
include:
- language: actions
build-mode: none
- language: go
build-mode: autobuild
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
# Use `c-cpp` to analyze code written in C, C++ or both
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout repository
uses: actions/checkout@v4
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# Add any setup steps before running the `github/codeql-action/init` action.
# This includes steps like installing compilers or runtimes (`actions/setup-node`
# or others). This is typically only required for manual builds.
# - name: Setup runtime (example)
# uses: actions/setup-example@v1
- name: Autobuild
uses: github/codeql-action/autobuild@v3
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: '/language:${{matrix.language}}'
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
# If the analyze step fails for one of the languages you are analyzing with
# "We were unable to automatically build your code", modify the matrix above
# to set the build mode to "manual" for that language. Then modify this step
# to build your code.
# Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
- if: matrix.build-mode == 'manual'
shell: bash
run: |
echo 'If you are using a "manual" build mode for one or more of the' \
'languages you are analyzing, replace this with the commands to build' \
'your code, for example:'
echo ' make bootstrap'
echo ' make release'
exit 1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"

View File

@ -1,22 +0,0 @@
name: Dependency Review
on: [workflow_call] # [pull_request]
permissions:
contents: read
jobs:
dependency-review:
runs-on: ubuntu-latest
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v4
- name: 'Dependency Review'
uses: actions/dependency-review-action@v4
with:
fail-on-severity: moderate
comment-summary-in-pr: always
# # Use comma-separated names to pass list arguments:
# deny-licenses: LGPL-2.0, BSD-2-Clause

View File

@ -1,47 +0,0 @@
name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.21.x
- name: Run tests
run: go test -v ./...
- name: Build binaries
run: |
# Build for different platforms
GOOS=windows GOARCH=amd64 go build -o articulate-parser-windows-amd64.exe main.go
GOOS=linux GOARCH=amd64 go build -o articulate-parser-linux-amd64 main.go
GOOS=darwin GOARCH=amd64 go build -o articulate-parser-darwin-amd64 main.go
GOOS=darwin GOARCH=arm64 go build -o articulate-parser-darwin-arm64 main.go
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: |
articulate-parser-windows-amd64.exe
articulate-parser-linux-amd64
articulate-parser-darwin-amd64
articulate-parser-darwin-arm64
generate_release_notes: true
draft: false
prerelease: ${{ startsWith(github.ref, 'refs/tags/v0.') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}