Skip to content

Commit

Permalink
Merge pull request #1684 from github/mbg/add-resolve-environment
Browse files Browse the repository at this point in the history
  • Loading branch information
mbg authored Jun 15, 2023
2 parents ee2b24e + d4006d9 commit 0ac1815
Show file tree
Hide file tree
Showing 15 changed files with 453 additions and 5 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/__resolve-environment-action.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## [UNRELEASED]

No user facing changes.
- Experimental: add a new `resolve-environment` action which attempts to infer a configuration for the build environment that is required to build a given project. Do not use this in production as it is part of an internal experiment and subject to change at any time.

## 2.20.0 - 13 Jun 2023

Expand Down
2 changes: 1 addition & 1 deletion lib/actions-util.js.map

Large diffs are not rendered by default.

25 changes: 24 additions & 1 deletion lib/codeql.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/codeql.js.map

Large diffs are not rendered by default.

82 changes: 82 additions & 0 deletions lib/resolve-environment-action.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/resolve-environment-action.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

49 changes: 49 additions & 0 deletions lib/resolve-environment.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/resolve-environment.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions pr-checks/checks/resolve-environment-action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: "Resolve environment"
description: "Tests that the resolve-environment action works for Go"
versions: ["stable-v2.13.4"]
steps:
- uses: ./../action/init
with:
languages: go
tools: ${{ steps.prepare-test.outputs.tools-url }}

- uses: ./../action/resolve-environment
id: resolve-environment
with:
language: go

- name: "Fail if no Go configuration was returned"
if: (!fromJSON(steps.resolve-environment.outputs.environment).configuration.go)
run: exit 1
23 changes: 23 additions & 0 deletions resolve-environment/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: 'CodeQL: Resolve Build Environment'
description: '[Experimental] Attempt to infer a build environment suitable for automatic builds'
author: 'GitHub'
inputs:
token:
default: ${{ github.token }}
matrix:
default: ${{ toJson(matrix) }}
language:
description: The language to infer the build environment configuration for.
required: true
working-directory:
description: >-
Resolve the build environment based on the files located at the specified
path (relative to $GITHUB_WORKSPACE). If this input is not set, then the
build environment is resolved based on the files in $GITHUB_WORKSPACE.
required: false
outputs:
environment:
description: The inferred build environment configuration.
runs:
using: 'node16'
main: '../lib/resolve-environment-action.js'
3 changes: 2 additions & 1 deletion src/actions-util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,8 @@ type ActionName =
| "autobuild"
| "finish"
| "upload-sarif"
| "init-post";
| "init-post"
| "resolve-environment";
export type ActionStatus =
| "starting"
| "aborted"
Expand Down
Loading

0 comments on commit 0ac1815

Please sign in to comment.