Skip to content

Commit e36f252

Browse files
committed
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.
1 parent bb37ebd commit e36f252

File tree

6 files changed

+220
-98
lines changed

6 files changed

+220
-98
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ body:
2929
value: |
3030
1.
3131
2.
32-
3.
32+
3.
3333
validations:
3434
required: true
3535

.github/stale.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Configuration for probot-stale - https://github.com/probot/stale
2+
3+
# Number of days of inactivity before an issue becomes stale
4+
daysUntilStale: 60
5+
6+
# Number of days of inactivity before a stale issue is closed
7+
daysUntilClose: 14
8+
9+
# Issues with these labels will never be considered stale
10+
exemptLabels:
11+
- pinned
12+
- security
13+
- bug
14+
- enhancement
15+
- documentation
16+
- "in progress"
17+
18+
# Label to use when marking an issue as stale
19+
staleLabel: stale
20+
21+
# Comment to post when marking an issue as stale
22+
markComment: >
23+
This issue has been automatically marked as stale because it has not had
24+
recent activity. It will be closed in 14 days if no further activity occurs.
25+
Thank you for your contributions to Articulate Rise Parser!
26+
27+
# Comment to post when closing a stale issue
28+
closeComment: >
29+
This issue has been automatically closed due to inactivity.
30+
Feel free to reopen if this is still relevant.
31+
32+
# Limit to only specific repos (optional)
33+
# only:
34+
# - repo1
35+
# - repo2
36+
37+
# Limit the number of actions per hour, from 1-30. Default is 30
38+
limitPerRun: 30
39+
40+
# Set to true to ignore issues in a project (defaults to false)
41+
exemptProjects: false
42+
43+
# Set to true to ignore issues in a milestone (defaults to false)
44+
exemptMilestones: true
45+
46+
# Set to true to ignore issues with an assignee (defaults to false)
47+
exemptAssignees: true
48+
49+
# Label to use when marking a pull request as stale
50+
stalePrLabel: stale-pr
51+
52+
# Comment to post when marking a pull request as stale
53+
markPrComment: >
54+
This pull request has been automatically marked as stale because it has not had
55+
recent activity. It will be closed in 14 days if no further activity occurs.
56+
Thank you for your contributions to Articulate Rise Parser!
57+
58+
# Comment to post when closing a stale pull request
59+
closePrComment: >
60+
This pull request has been automatically closed due to inactivity.
61+
Feel free to reopen if you want to continue working on this.
62+
63+
# Limit to only `issues` or `pulls` (optional)
64+
# only: issues
65+
66+
# Set to true to ignore PRs with the WIP label or title prefix (defaults to false)
67+
exemptWIP: true

.github/workflows/ci.yml

Lines changed: 68 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@ name: CI
22

33
on:
44
push:
5-
branches: [master, develop]
5+
branches: [ "master", "develop" ]
6+
tags:
7+
- "v*.*.*"
68
pull_request:
7-
branches: [master, develop]
9+
branches: [ "master", "develop" ]
810

911
jobs:
1012
test:
13+
name: Test
1114
runs-on: ubuntu-latest
1215
strategy:
1316
matrix:
@@ -49,11 +52,73 @@ jobs:
4952
- name: Upload coverage reports to Codecov
5053
uses: codecov/codecov-action@v5
5154
with:
52-
token: ${{ secrets.CODECOV_TOKEN }}
55+
flags: Go ${{ matrix.go }}
5356
slug: kjanat/articulate-parser
57+
token: ${{ secrets.CODECOV_TOKEN }}
5458

5559
- name: Upload test results to Codecov
5660
if: ${{ !cancelled() }}
5761
uses: codecov/test-results-action@v1
5862
with:
63+
flags: Go ${{ matrix.go }}
5964
token: ${{ secrets.CODECOV_TOKEN }}
65+
66+
dependency-review:
67+
name: Dependency Review
68+
runs-on: ubuntu-latest
69+
permissions:
70+
contents: read
71+
if: github.event_name == 'pull_request'
72+
steps:
73+
- name: 'Checkout Repository'
74+
uses: actions/checkout@v4
75+
76+
- name: 'Dependency Review'
77+
uses: actions/dependency-review-action@v4
78+
with:
79+
fail-on-severity: moderate
80+
comment-summary-in-pr: always
81+
82+
# # Use comma-separated names to pass list arguments:
83+
# deny-licenses: LGPL-2.0, BSD-2-Clause
84+
85+
release:
86+
name: Release
87+
runs-on: ubuntu-latest
88+
if: github.ref_type == 'tag'
89+
permissions:
90+
contents: write
91+
needs: [ "test", "dependency-review" ]
92+
steps:
93+
- uses: actions/checkout@v4
94+
with:
95+
fetch-depth: 0
96+
97+
- name: Set up Go
98+
uses: actions/setup-go@v5
99+
with:
100+
go-version-file: 'go.mod'
101+
check-latest: true
102+
103+
- name: Run tests
104+
run: go test -v ./...
105+
106+
- name: Build binaries
107+
run: |
108+
# Build for different platforms
109+
OS = ["darwin", "freebsd", "linux", "windows"]
110+
ARCH = ["amd64", "arm64"]
111+
112+
for os in OS:
113+
for arch in ARCH:
114+
GOOS=$os GOARCH=$arch go build -o articulate-parser-$os-$arch main.go
115+
116+
- name: Create Release
117+
uses: softprops/action-gh-release@v2
118+
with:
119+
files: articulate-parser-*
120+
generate_release_notes: true
121+
draft: false
122+
prerelease: ${{ startsWith(github.ref, 'refs/tags/v0.') }}
123+
env:
124+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/codeql.yml

Lines changed: 84 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,100 @@
1-
name: CodeQL
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
213

314
on:
4-
workflow_call:
5-
# push:
6-
# branches: [master, develop]
7-
# pull_request:
8-
# branches: [master]
9-
# schedule:
10-
# - cron: '30 1 * * 0'
15+
push:
16+
branches: [ "master" ]
17+
pull_request:
18+
branches: [ "master" ]
19+
schedule:
20+
- cron: '44 16 * * 6'
1121

1222
jobs:
1323
analyze:
14-
name: Analyze
15-
runs-on: ubuntu-latest
24+
name: Analyze (${{ matrix.language }})
25+
# Runner size impacts CodeQL analysis time. To learn more, please see:
26+
# - https://gh.io/recommended-hardware-resources-for-running-codeql
27+
# - https://gh.io/supported-runners-and-hardware-resources
28+
# - https://gh.io/using-larger-runners (GitHub.com only)
29+
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
30+
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
1631
permissions:
32+
# required for all workflows
33+
security-events: write
34+
35+
# required to fetch internal or private CodeQL packs
36+
packages: read
37+
38+
# only required for workflows in private repositories
1739
actions: read
1840
contents: read
19-
security-events: write
2041

2142
strategy:
2243
fail-fast: false
2344
matrix:
24-
language: ['go']
25-
45+
include:
46+
- language: actions
47+
build-mode: none
48+
- language: go
49+
build-mode: autobuild
50+
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
51+
# Use `c-cpp` to analyze code written in C, C++ or both
52+
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
53+
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
54+
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
55+
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
56+
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
57+
# 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
2658
steps:
27-
- name: Checkout repository
28-
uses: actions/checkout@v4
59+
- name: Checkout repository
60+
uses: actions/checkout@v4
61+
62+
# Add any setup steps before running the `github/codeql-action/init` action.
63+
# This includes steps like installing compilers or runtimes (`actions/setup-node`
64+
# or others). This is typically only required for manual builds.
65+
# - name: Setup runtime (example)
66+
# uses: actions/setup-example@v1
67+
68+
# Initializes the CodeQL tools for scanning.
69+
- name: Initialize CodeQL
70+
uses: github/codeql-action/init@v3
71+
with:
72+
languages: ${{ matrix.language }}
73+
build-mode: ${{ matrix.build-mode }}
74+
# If you wish to specify custom queries, you can do so here or in a config file.
75+
# By default, queries listed here will override any specified in a config file.
76+
# Prefix the list here with "+" to use these queries and those in the config file.
2977

30-
- name: Initialize CodeQL
31-
uses: github/codeql-action/init@v3
32-
with:
33-
languages: ${{ matrix.language }}
78+
# 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
79+
# queries: security-extended,security-and-quality
3480

35-
- name: Autobuild
36-
uses: github/codeql-action/autobuild@v3
81+
# If the analyze step fails for one of the languages you are analyzing with
82+
# "We were unable to automatically build your code", modify the matrix above
83+
# to set the build mode to "manual" for that language. Then modify this step
84+
# to build your code.
85+
# ℹ️ Command-line programs to run using the OS shell.
86+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
87+
- if: matrix.build-mode == 'manual'
88+
shell: bash
89+
run: |
90+
echo 'If you are using a "manual" build mode for one or more of the' \
91+
'languages you are analyzing, replace this with the commands to build' \
92+
'your code, for example:'
93+
echo ' make bootstrap'
94+
echo ' make release'
95+
exit 1
3796
38-
- name: Perform CodeQL Analysis
39-
uses: github/codeql-action/analyze@v3
40-
with:
41-
category: '/language:${{matrix.language}}'
97+
- name: Perform CodeQL Analysis
98+
uses: github/codeql-action/analyze@v3
99+
with:
100+
category: "/language:${{matrix.language}}"

.github/workflows/dependency-review.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 0 additions & 47 deletions
This file was deleted.

0 commit comments

Comments
 (0)