Skip to content

Commit 5f60d1d

Browse files
authored
Add CodeQL run for GitHub Actions (#343)
* Add CodeQL run for GitHub Actions CodeQL now supports analysis of GitHub Action scripts. * Add permissions * Remove old pre-release changelog
1 parent 1dfcd4b commit 5f60d1d

3 files changed

Lines changed: 59 additions & 5 deletions

File tree

.github/workflows/codeql-analysis-reusable.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ on:
2727
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'kotlin', 'python', 'ruby' ]
2828
# Learn more about CodeQL language support at https://git.io/codeql-language-support
2929
language:
30-
description:
30+
description: Language used in the repository
3131
default: java
3232
type: string
3333

@@ -45,7 +45,8 @@ jobs:
4545
- name: Initialize CodeQL
4646
uses: github/codeql-action/init@6bb031afdd8eb862ea3fc1848194185e076637e5 # 3.28.11
4747
with:
48-
languages: ${{ inputs.language }}
48+
# Also check GitHub Actions
49+
languages: ${{ inputs.language }}, actions
4950

5051
- name: Setup JDK
5152
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # 4.7.0
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
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+
##
19+
# Perform CodeQL analysis of GitHub Actions
20+
name: codeql-analysis
21+
22+
on:
23+
push:
24+
branches: [ "main" ]
25+
pull_request:
26+
branches: [ "main" ]
27+
schedule:
28+
- cron: '32 12 * * 5'
29+
30+
permissions: {}
31+
32+
jobs:
33+
34+
analyze:
35+
name: Analyze
36+
runs-on: ubuntu-latest
37+
# Permissions required to publish Security Alerts
38+
permissions:
39+
actions: read
40+
contents: read
41+
security-events: write
42+
43+
steps:
44+
45+
- name: Checkout repository
46+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2
47+
48+
- name: Initialize CodeQL
49+
uses: github/codeql-action/init@9e8d0789d4a0fa9ceb6b1738f7e269594bdd67f0 # 3.28.9
50+
with:
51+
languages: actions
52+
53+
- name: Perform CodeQL Analysis
54+
uses: github/codeql-action/analyze@9e8d0789d4a0fa9ceb6b1738f7e269594bdd67f0 # 3.28.9

src/changelog/.11.x.x/update_dependabot_fetch_metadata.xml renamed to src/changelog/.12.x.x/codeql_for_gha.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
<entry xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
33
xmlns="https://logging.apache.org/xml/ns"
44
xsi:schemaLocation="https://logging.apache.org/xml/ns https://logging.apache.org/xml/ns/log4j-changelog-0.xsd"
5-
type="updated">
6-
<issue id="322" link="https://github.com/apache/logging-parent/pull/322"/>
7-
<description format="asciidoc">Update `dependabot/fetch-metadata` to version `2.3.0`</description>
5+
type="changed">
6+
<description format="asciidoc">Add "GitHub Actions" to the list of languages analyzed by CodeQL.</description>
87
</entry>

0 commit comments

Comments
 (0)