-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from suzuki-shunsuke/feat/first-pr
feat: implement basic function
- Loading branch information
Showing
7 changed files
with
175 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: renovate-config-validator | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- .github/workflows/renovate-config-validator.yaml | ||
- renovate.json | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- .github/workflows/renovate-config-validator.yaml | ||
- renovate.json | ||
|
||
jobs: | ||
validate: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: suzuki-shunsuke/github-action-renovate-config-validator@v0.1.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
name: test | ||
on: | ||
pull_request: | ||
branches: [main] | ||
env: | ||
AQUA_LOG_COLOR: always | ||
jobs: | ||
ci-info: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: aquaproj/aqua-installer@v1.1.1 | ||
with: | ||
aqua_version: v1.19.1 | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
- uses: ./store | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
|
||
test: | ||
needs: ci-info | ||
strategy: | ||
matrix: | ||
env: | ||
- runs-on: windows-latest | ||
- runs-on: ubuntu-latest | ||
runs-on: ${{ matrix.env.runs-on }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./restore | ||
- run: echo "$CI_INFO_PR_NUMBER" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,58 @@ | ||
# ci-info-action | ||
GitHub Actiions for ci-info | ||
|
||
GitHub Actiions for [ci-info](https://github.com/suzuki-shunsuke/ci-info). | ||
This is useful to decrease GitHub API call by caching ci-info result. | ||
|
||
ci-info-action has two actions. | ||
|
||
* [store](store): Run ci-info and save the result as an artifact | ||
* [restore](restore): Restore ci-info result from an artifact | ||
|
||
## :warning: This action doesn't install ci-info | ||
|
||
`store` action depends on ci-info, so you have to [install ci-info yourself](https://github.com/suzuki-shunsuke/ci-info#install). | ||
`restore` action depends on `store` action, but doesn't depend on ci-info. | ||
|
||
## Example | ||
|
||
```yaml | ||
jobs: | ||
ci-info: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
# Install ci-info with aqua | ||
- uses: aquaproj/aqua-installer@v1.1.1 | ||
with: | ||
aqua_version: v1.19.1 | ||
|
||
# Run ci-info and store the result as an artifact | ||
- uses: suzuki-shunsuke/ci-info-action/store@main | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
|
||
# Refer ci-info result | ||
- run: echo "$CI_INFO_PR_NUMBER" | ||
|
||
test: | ||
needs: ci-info | ||
strategy: | ||
matrix: | ||
env: | ||
- runs-on: windows-latest | ||
- runs-on: ubuntu-latest | ||
runs-on: ${{ matrix.env.runs-on }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
# Restore ci-info result from an artifact | ||
- uses: suzuki-shunsuke/ci-info-action/restore@main | ||
|
||
# Refer ci-info result | ||
- run: echo "$CI_INFO_PR_NUMBER" | ||
``` | ||
|
||
## LICENSE | ||
|
||
[MIT](LICENSE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
# aqua - Declarative CLI Version Manager | ||
# https://aquaproj.github.io/ | ||
registries: | ||
- type: standard | ||
ref: v3.26.0 # renovate: depName=aquaproj/aqua-registry | ||
packages: | ||
- name: suzuki-shunsuke/ci-info@v2.1.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"extends": [ | ||
"config:base", | ||
"github>suzuki-shunsuke/renovate-config", | ||
"github>aquaproj/aqua-renovate-config#1.2.2" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: restore | ||
description: Restore ci-info result from an artifact | ||
inputs: | ||
cache-name: | ||
description: 'cache name' | ||
required: false | ||
default: ci-info | ||
path: | ||
description: 'Destination path' | ||
required: false | ||
outputs: | ||
download-path: | ||
value: ${{steps.download.outputs.download-path}} | ||
runs: | ||
using: composite | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
id: download | ||
with: | ||
name: ${{inputs.cache-name}} | ||
path: ${{inputs.path}} | ||
- run: cat "$CI_INFO_TEMP_DIR/env" | sed "s|^CI_INFO_TEMP_DIR=.*$|CI_INFO_TEMP_DIR=$CI_INFO_TEMP_DIR|" >> "$GITHUB_ENV" | ||
shell: bash | ||
env: | ||
CI_INFO_TEMP_DIR: ${{steps.download.outputs.download-path}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: store | ||
description: Run ci-info and save the result as artifact | ||
inputs: | ||
cache-name: | ||
description: 'cache name' | ||
required: false | ||
default: ci-info | ||
runs: | ||
using: composite | ||
steps: | ||
- run: | | ||
tempfile="$(mktemp)" | ||
ci-info run | sed "s/^export //" > "${tempfile}" | ||
cat "$tempfile" >> "$GITHUB_ENV" | ||
. "$tempfile" | ||
cp "$tempfile" "${CI_INFO_TEMP_DIR}/env" | ||
shell: bash | ||
env: | ||
GITHUB_TOKEN: ${{ inputs.github_token }} | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: ci-info | ||
path: ${{env.CI_INFO_TEMP_DIR}} |