Skip to content
Draft
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
30 changes: 30 additions & 0 deletions pr-checks/action-versions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
export const ACTION_VERSIONS = {
"actions/checkout": {
"version": "v6"
},
"actions/setup-go": {
"version": "v6"
},
"actions/setup-dotnet": {
"version": "v5"
},
"actions/upload-artifact": {
"version": "v7"
},
"actions/github-script": {
"version": "v8"
},
"actions/setup-python": {
"version": "v6"
},
"actions/setup-java": {
"version": "v5"
},
"actions/setup-node": {
"version": "v6"
},
"ruby/setup-ruby": {
"version": "09a7688d3b55cf0e976497ff046b70949eeaccfd",
"comment": " v1.288.0"
}
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: "Autobuild direct tracing (custom working directory)"
description: >
description: |
An end-to-end integration test of a Java repository built using 'build-mode: autobuild',
with direct tracing enabled and a custom working directory specified as the input to the
autobuild Action.
Expand Down
17 changes: 8 additions & 9 deletions pr-checks/checks/init-with-registries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@
# basic mechanics of multi-registry auth is working.
name: "Packaging: Download using registries"
description: "Checks that specifying a registries block and associated auth works as expected"
versions: [
# This feature is not compatible with older CLIs
"default",
"linked",
"nightly-latest",
]
versions:
# This feature is not compatible with older CLIs
- "default"
- "linked"
- "nightly-latest"

permissions:
contents: read
Expand All @@ -24,9 +23,9 @@ steps:
config-file: ./.github/codeql/codeql-config-registries.yml
languages: javascript
registries: |
- url: "https://ghcr.io/v2/"
packages: "*/*"
token: "${{ secrets.GITHUB_TOKEN }}"
- url: "https://ghcr.io/v2/"
packages: "*/*"
token: "${{ secrets.GITHUB_TOKEN }}"

- name: Verify packages installed
run: |
Expand Down
2 changes: 1 addition & 1 deletion pr-checks/checks/overlay-init-fallback.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ versions: ["linked", "nightly-latest"]
steps:
- uses: ./../action/init
with:
languages: actions # Any language without overlay support will do
languages: actions # Any language without overlay support will do
tools: ${{ steps.prepare-test.outputs.tools-url }}
env:
CODEQL_OVERLAY_DATABASE_MODE: overlay-base
Expand Down
23 changes: 17 additions & 6 deletions pr-checks/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import * as path from "path";

import * as yaml from "yaml";

import { ACTION_VERSIONS } from "./action-versions";

/** Known workflow input names. */
enum KnownInputName {
GoVersion = "go-version",
Expand All @@ -13,6 +15,9 @@ enum KnownInputName {
DotnetVersion = "dotnet-version",
}

/** Known Action names that we have version information for. */
type KnownAction = keyof typeof ACTION_VERSIONS;

/**
* Represents workflow input definitions.
*/
Expand Down Expand Up @@ -94,6 +99,12 @@ const THIS_DIR = __dirname;
const CHECKS_DIR = path.join(THIS_DIR, "checks");
const OUTPUT_DIR = path.join(THIS_DIR, "..", ".github", "workflows");

/** Gets an `actionName@ref` string for `actionName`. */
function getActionRef(actionName: KnownAction): string {
const versionInfo = ACTION_VERSIONS[actionName];
return `${actionName}@${versionInfo.version}`;
}

/**
* Loads and parses a YAML file.
*/
Expand Down Expand Up @@ -216,7 +227,7 @@ function main(): void {
const steps: any[] = [
{
name: "Check out repository",
uses: "actions/checkout@v6",
uses: getActionRef("actions/checkout"),
},
];

Expand All @@ -226,7 +237,7 @@ function main(): void {
steps.push(
{
name: "Install Node.js",
uses: "actions/setup-node@v6",
uses: getActionRef("actions/setup-node"),
with: {
"node-version": "20.x",
cache: "npm",
Expand Down Expand Up @@ -265,7 +276,7 @@ function main(): void {

steps.push({
name: "Install Go",
uses: "actions/setup-go@v6",
uses: getActionRef("actions/setup-go"),
with: {
"go-version":
"${{ inputs.go-version || '" + baseGoVersionExpr + "' }}",
Expand All @@ -289,7 +300,7 @@ function main(): void {

steps.push({
name: "Install Java",
uses: "actions/setup-java@v5",
uses: getActionRef("actions/setup-java"),
with: {
"java-version":
"${{ inputs.java-version || '" + baseJavaVersionExpr + "' }}",
Expand All @@ -312,7 +323,7 @@ function main(): void {
steps.push({
name: "Install Python",
if: "matrix.version != 'nightly-latest'",
uses: "actions/setup-python@v6",
uses: getActionRef("actions/setup-python"),
with: {
"python-version":
"${{ inputs.python-version || '" + basePythonVersionExpr + "' }}",
Expand All @@ -333,7 +344,7 @@ function main(): void {

steps.push({
name: "Install .NET",
uses: "actions/setup-dotnet@v5",
uses: getActionRef("actions/setup-dotnet"),
with: {
"dotnet-version":
"${{ inputs.dotnet-version || '" + baseDotNetVersionExpr + "' }}",
Expand Down
Loading
Loading