Skip to content

Commit 4f034ac

Browse files
committed
Synchronize .github directory between 2.x and main
1 parent 196159c commit 4f034ac

File tree

9 files changed

+157
-63
lines changed

9 files changed

+157
-63
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
name: Bug report
3+
about: Submit a bug report
4+
---
5+
6+
## Description
7+
8+
[A clear and concise description of what the bug is.]
9+
10+
## Configuration
11+
12+
**Version:** [Log4j version]
13+
14+
**Operating system:** [OS and version]
15+
16+
**JDK:** [JDK distribution and version]
17+
18+
## Logs
19+
20+
```
21+
[Stacktraces, errors, etc. relevant applications logs.]
22+
```
23+
24+
## Reproduction
25+
26+
[An isolated test reproducing the test.
27+
JUnit tests similar to the ones in the code base are extremely appreciated.]
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
name: Feature request
3+
about: Submit a feature request
4+
---
5+
6+
**Warning!**
7+
It is highly recommended to discuss feature requests in [the mailing lists](https://logging.apache.org/log4j/2.x/support.html) first.
8+
9+
[A clear and concise description of the feature requested.]

.github/ISSUE_TEMPLATE/question.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
name: Question
3+
about: Ask a question
4+
---
5+
6+
As clearly indicated in [the Log4j support page](https://logging.apache.org/log4j/2.x/support.html#issues), **please use mailing lists for questions!**
7+
8+
Issues asking questions will be removed, and you will be asked to post questions to the mailing lists instead.

.github/generate-email.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,15 @@ PROJECT_VERSION="$2"
4141
COMMIT_ID="$3"
4242

4343
# Check release notes file
44-
RELEASE_NOTES_FILE="$SCRIPT_DIR/../target/generated-sources/site/asciidoc/release-notes/$PROJECT_VERSION.adoc"
44+
RELEASE_NOTES_FILE="$SCRIPT_DIR/../src/site/_release-notes/_$PROJECT_VERSION.adoc"
4545
[ -f "$RELEASE_NOTES_FILE" ] || {
4646
stderr "Couldn't find release notes file: $RELEASE_NOTES_FILE"
4747
exit 1
4848
}
4949

5050
dump_release_notes() {
51-
awk "f{print} /^Release date::/{f=1}" "$RELEASE_NOTES_FILE"
51+
awk "f{print} /^Release date::/{f=1}" "$RELEASE_NOTES_FILE" \
52+
| sed -r 's!'$PROJECT_REPO'/(issues|pull)/[0-9]+\[([0-9]+)\]!#\2!g'
5253
}
5354

5455
case $1 in
@@ -77,7 +78,7 @@ net negative vote count. All votes are welcome and we encourage
7778
everyone to test the release, but only the Logging Services PMC
7879
votes are officially counted.
7980
80-
=== Release Notes
81+
== Release Notes
8182
EOF
8283
dump_release_notes
8384
;;
@@ -96,7 +97,7 @@ website[1].
9697
9798
[1] $PROJECT_SITE
9899
99-
=== Release Notes
100+
== Release Notes
100101
EOF
101102
dump_release_notes
102103
;;

.github/pull_request_template.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[A clear and concise description of what the pull request is for along with a reference to the associated issue IDs, if they exist.]
2+
3+
## Checklist
4+
5+
* Base your changes on `2.x` branch if you are targeting Log4j 2; use `main` otherwise
6+
* `./mvnw verify` succeeds (if it fails due to code formatting issues reported by Spotless, simply run `./mvnw spotless:apply` and retry)
7+
* Non-trivial changes contain an entry file in the `src/changelog/.2.x.x` directory
8+
* Tests for the changes are provided
9+
* [Commits are signed](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits) (optional, but highly recommended)

.github/workflows/build.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,33 +41,37 @@ jobs:
4141
uses: apache/logging-parent/.github/workflows/build-reusable.yaml@main
4242
with:
4343
java-version: 11
44+
site-enabled: true
4445

4546
deploy-snapshot:
4647
needs: build
47-
if: github.repository == 'apache/logging-log4j2' && github.ref_name == '2.x'
48+
if: github.repository == 'apache/logging-log4j2' && github.ref_name == 'main'
4849
uses: apache/logging-parent/.github/workflows/deploy-snapshot-reusable.yaml@main
4950
# Secrets for deployments
5051
secrets:
5152
NEXUS_USER: ${{ secrets.NEXUS_USER }}
5253
NEXUS_PW: ${{ secrets.NEXUS_PW }}
54+
with:
55+
java-version: 11
5356

5457
deploy-release:
5558
needs: build
5659
if: github.repository == 'apache/logging-log4j2' && startsWith(github.ref_name, 'release/')
5760
uses: apache/logging-parent/.github/workflows/deploy-release-reusable.yaml@main
5861
# Secrets for deployments
5962
secrets:
60-
GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
63+
GPG_SECRET_KEY: ${{ secrets.LOGGING_GPG_SECRET_KEY }}
6164
LOGGING_STAGE_DEPLOYER_USER: ${{ secrets.LOGGING_STAGE_DEPLOYER_USER }}
6265
LOGGING_STAGE_DEPLOYER_PW: ${{ secrets.LOGGING_STAGE_DEPLOYER_PW }}
63-
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
64-
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
66+
SVN_USERNAME: ${{ secrets.LOGGING_SVN_DEV_USERNAME }}
67+
SVN_PASSWORD: ${{ secrets.LOGGING_SVN_DEV_PASSWORD }}
6568
# Write permissions to allow the Maven `revision` property update, changelog release, etc.
6669
permissions:
6770
contents: write
6871
with:
69-
project-id: log4j2
72+
java-version: 11
73+
project-id: log4j
7074
distribution-attachment-filepath-pattern: |-
71-
'^.*/target/log4j-(1\.2-api|api(-test)?|appserver|cassandra|core(-test)?|couchdb|docker|flume-ng|iostreams|jakarta-(smtp|web)|jcl|jdbc-dbcp2|jpa|jpl|jul|kubernetes|layout-template-json|mongodb[34]|log4j-slf4j2?-impl|log4j-spring-(boot|cloud-config-client)|taglib|to-(jul|slf4j)|web)'${PROJECT_VERSION}'(-sources)?\.jar$'
72-
distribution-attachment-count: 1
75+
'^.*/target/log4j-(1\\.2-api|api(-test)?|appserver|cassandra|core(-test)?|couchdb|docker|flume-ng|iostreams|jakarta-(smtp|web)|jcl|jdbc-dbcp2|jpa|jpl|jul|kubernetes|layout-template-json|mongodb[34]|slf4j2?-impl|spring-(boot|cloud-config-client)|taglib|to-(jul|slf4j)|web)-'${PROJECT_VERSION}'\\.jar$'
76+
distribution-attachment-count: 30
7377
site-enabled: true

.github/workflows/codeql-analysis.yml

Lines changed: 7 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,13 @@
1515
# limitations under the License.
1616
#
1717

18-
name: "CodeQL"
18+
name: codeql-analysis
1919

2020
on:
2121
push:
22-
branches: [ master ]
22+
branches: [ "2.x", "main" ]
2323
pull_request:
24-
# The branches below must be a subset of the branches above
25-
branches: [ master ]
24+
branches: [ "2.x", "main" ]
2625
schedule:
2726
- cron: '32 12 * * 5'
2827

@@ -31,51 +30,11 @@ permissions: read-all
3130
jobs:
3231

3332
analyze:
34-
name: Analyze
35-
runs-on: ubuntu-latest
33+
uses: apache/logging-parent/.github/workflows/codeql-analysis-reusable.yaml@main
34+
with:
35+
java-version: 11
36+
# Permissions required to publish Security Alerts
3637
permissions:
3738
actions: read
3839
contents: read
3940
security-events: write
40-
41-
strategy:
42-
fail-fast: false
43-
matrix:
44-
language: [ 'java' ]
45-
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
46-
# Learn more about CodeQL language support at https://git.io/codeql-language-support
47-
48-
steps:
49-
50-
- name: Checkout repository
51-
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # 3.6.0
52-
with:
53-
fetch-depth: 32
54-
55-
# Initializes the CodeQL tools for scanning.
56-
- name: Initialize CodeQL
57-
uses: github/codeql-action/init@6a28655e3dcb49cb0840ea372fd6d17733edd8a4 # 2.21.8
58-
with:
59-
languages: ${{ matrix.language }}
60-
# If you wish to specify custom queries, you can do so here or in a config file.
61-
# By default, queries listed here will override any specified in a config file.
62-
# Prefix the list here with "+" to use these queries and those in the config file.
63-
# queries: ./path/to/local/query, your-org/your-repo/queries@main
64-
65-
- name: Setup JDK 11
66-
uses: actions/setup-java@cd89f46ac9d01407894225f350157564c9c7cee2 # 3.12.0
67-
with:
68-
distribution: temurin
69-
java-version: 11
70-
cache: maven
71-
72-
- name: Build with Maven
73-
timeout-minutes: 60
74-
shell: bash
75-
run: |
76-
./mvnw \
77-
--show-version --batch-mode --errors --no-transfer-progress \
78-
-DskipTests
79-
80-
- name: Perform CodeQL Analysis
81-
uses: github/codeql-action/analyze@6a28655e3dcb49cb0840ea372fd6d17733edd8a4 # 2.21.8

.github/workflows/merge-dependabot.yaml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,20 @@ permissions: read-all
2929
jobs:
3030

3131
build:
32-
if: github.repository == 'apache/logging-log4j-kotlin' && github.event_name == 'pull_request_target' && github.actor == 'dependabot[bot]'
32+
if: github.repository == 'apache/logging-log4j2' && github.event_name == 'pull_request_target' && github.actor == 'dependabot[bot]'
3333
uses: apache/logging-parent/.github/workflows/build-reusable.yaml@main
34+
with:
35+
java-version: |
36+
8
37+
11
3438
3539
merge-dependabot:
3640
needs: build
3741
uses: apache/logging-parent/.github/workflows/merge-dependabot-reusable.yaml@main
42+
java-version: |
43+
11
3844
permissions:
39-
contents: write # to push changelog commits
40-
pull-requests: write # to close the PR
45+
contents: write # to push changelog commits
46+
pull-requests: write # to close the PR
4147
secrets:
42-
GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }} # to sign commits
48+
GPG_SECRET_KEY: ${{ secrets.LOGGING_GPG_SECRET_KEY }} # to sign commits
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one or more
3+
# contributor license agreements. See the NOTICE file distributed with
4+
# this work for additional information regarding copyright ownership.
5+
# The ASF licenses this file to you under the Apache License, Version 2.0
6+
# (the "License"); you may not use this file except in compliance with
7+
# the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
18+
name: scorecards-analysis
19+
20+
on:
21+
branch_protection_rule:
22+
schedule:
23+
- cron: "30 1 * * 6" # Weekly on Saturdays
24+
push:
25+
branches: [ "2.x", "main" ]
26+
27+
permissions: read-all
28+
29+
jobs:
30+
31+
analysis:
32+
33+
name: "Scorecards analysis"
34+
runs-on: ubuntu-latest
35+
permissions:
36+
# Needed to upload the results to the code-scanning dashboard.
37+
security-events: write
38+
actions: read
39+
id-token: write # This is required for requesting the JWT
40+
contents: read # This is required for actions/checkout
41+
42+
steps:
43+
44+
- name: "Checkout code"
45+
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # 4.1.0
46+
with:
47+
persist-credentials: false
48+
49+
- name: "Run analysis"
50+
uses: ossf/scorecard-action@08b4669551908b1024bb425080c797723083c031 # 2.2.0
51+
with:
52+
results_file: results.sarif
53+
results_format: sarif
54+
# A read-only PAT token, which is sufficient for the action to function.
55+
# The relevant discussion: https://github.com/ossf/scorecard-action/issues/188
56+
repo_token: ${{ secrets.GITHUB_TOKEN }}
57+
# Publish the results for public repositories to enable scorecard badges.
58+
# For more details: https://github.com/ossf/scorecard-action#publishing-results
59+
publish_results: true
60+
61+
- name: "Upload artifact"
62+
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # 3.1.0
63+
with:
64+
name: SARIF file
65+
path: results.sarif
66+
retention-days: 5
67+
68+
- name: "Upload to code-scanning"
69+
uses: github/codeql-action/upload-sarif@2cb752a87e96af96708ab57187ab6372ee1973ab # 2.1.22
70+
with:
71+
sarif_file: results.sarif

0 commit comments

Comments
 (0)