mirror of
https://gitea.com/gitea/runner.git
synced 2026-11-12 19:03:45 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d5e4baed54 | ||
|
|
d4caa7e065 | ||
|
|
de4160b023 | ||
|
|
609c0a0773 | ||
|
|
0c029f7e79 | ||
|
|
eef3c32eb2 | ||
|
|
c40b651873 | ||
|
|
b498341857 | ||
|
|
0d727eb262 | ||
|
|
7c71c94366 | ||
|
|
49d2cb0cb5 | ||
|
|
85626b6bbd | ||
|
|
35400f76fa | ||
|
|
0cf31b2d22 | ||
|
|
c8cc7b2448 | ||
|
|
3be962cdb3 | ||
|
|
a5edbc9ac4 | ||
|
|
66bab3d805 | ||
|
|
293926f5d5 | ||
|
|
43c5ba923f | ||
|
|
acc5afc428 | ||
|
|
27a1a90d25 | ||
|
|
83ec0ba909 | ||
|
|
ed86e2f15a | ||
|
|
d4bebccc12 | ||
|
|
c75b67e892 | ||
|
|
bc6031eff7 | ||
|
|
c69c353d93 | ||
|
|
fcc016e9b3 | ||
|
|
d5caee38f2 | ||
|
|
9e26208e13 | ||
|
|
a05c5ba3ad | ||
|
|
c248520a66 | ||
|
|
10d639cc6b | ||
|
|
5a8134410d | ||
|
|
b79c3aa1a3 | ||
|
|
9c6499ec08 | ||
|
|
d139faa40c | ||
|
|
220efa69c0 | ||
|
|
df3cb60978 | ||
|
|
7e7096e60b | ||
|
|
8eea12dd78 | ||
|
|
c8fad20f49 | ||
|
|
1596e4b1fd | ||
|
|
c9e076db68 | ||
|
|
bc1842d649 | ||
|
|
90b8cc6a7a | ||
|
|
4d5a35ac65 | ||
|
|
8f81f40d62 | ||
|
|
9f90cba993 | ||
|
|
48b05a0ca8 | ||
|
|
9eb8b08a69 | ||
|
|
4d868b7f3c | ||
|
|
63a57edaa3 | ||
|
|
5180cd56e1 | ||
|
|
370989b2d0 | ||
|
|
71f470d670 | ||
|
|
c0c363bf59 | ||
|
|
0d71463662 | ||
|
|
ebcf341de7 | ||
|
|
14334f76ed | ||
|
|
f24e0721dc | ||
|
|
e36300ce28 | ||
|
|
09ddbe166f | ||
|
|
da0713e629 | ||
|
|
bbd055ac3b | ||
|
|
462b2660de | ||
|
|
ebdbfeb54a | ||
|
|
436b441cad | ||
|
|
552dbcdda9 | ||
|
|
a50b094c1a | ||
|
|
6cc53f16d8 | ||
|
|
8fcd56dc7b | ||
|
|
c9318f08e2 | ||
|
|
c7f8919470 | ||
|
|
14dfa5cc15 | ||
|
|
99a53a1f4c | ||
|
|
df2219eeb8 | ||
|
|
216f3d1740 | ||
|
|
8aa186897f | ||
|
|
3fa7707bc1 | ||
|
|
9038442191 | ||
|
|
c133be12d8 | ||
|
|
1072e3c383 | ||
|
|
a4513405b5 | ||
|
|
410765b516 | ||
|
|
06b9c3962e | ||
|
|
0b64655a40 | ||
|
|
75820a6a3e | ||
|
|
f1869f70b9 | ||
|
|
990cf93c71 | ||
|
|
f7a52789d9 | ||
|
|
cf27d3f300 | ||
|
|
7abe039c31 | ||
|
|
9ba9604256 | ||
|
|
6d2200b3d6 | ||
|
|
0cbdbd36b6 | ||
|
|
0f97dd873a | ||
|
|
8996b9b0e4 | ||
|
|
715d0e85ce | ||
|
|
1ab84ac8e8 | ||
|
|
1d50f0f5fd | ||
|
|
d1017d752f | ||
|
|
474683c0e8 | ||
|
|
03c4c4e116 | ||
|
|
b3e7d6a62d | ||
|
|
2354f5bb18 | ||
|
|
5781e233c1 | ||
|
|
f05e08a767 | ||
|
|
86f66eaa45 | ||
|
|
64c9856ba7 | ||
|
|
66ec50e427 | ||
|
|
44988db9f8 | ||
|
|
519726b46b | ||
|
|
3f676a742b | ||
|
|
e9e42e850b | ||
|
|
8f950ccec0 | ||
|
|
45de6199d1 | ||
|
|
ab4e06f977 | ||
|
|
cab56996b7 | ||
|
|
a13ed0c52e | ||
|
|
5fc35faf17 | ||
|
|
bfcc6f56f3 | ||
|
|
8f9d7506dc | ||
|
|
561bfad7c5 | ||
|
|
88ae188699 | ||
|
|
9830f34d36 | ||
|
|
8cffac65d9 | ||
|
|
2e1326b725 | ||
|
|
abdb547b1b | ||
|
|
d1114da299 | ||
|
|
cbd21b8ec5 | ||
|
|
d650bae0b6 | ||
|
|
222b5100b6 | ||
|
|
93e42d1465 | ||
|
|
93c8de3ec4 | ||
|
|
2442cdd8ad | ||
|
|
08c94bb564 | ||
|
|
d178051832 | ||
|
|
2f879c41c4 | ||
|
|
41b5fa6b55 | ||
|
|
378966e45f | ||
|
|
9c7d2be7c6 | ||
|
|
e08495af09 | ||
|
|
bf5e3dc302 | ||
|
|
a503f7429f | ||
|
|
cce60d466b | ||
|
|
7bebd2bbad | ||
|
|
d4c1515f4e | ||
|
|
45b0429b21 | ||
|
|
dada0730b0 | ||
|
|
c161a48a0a | ||
|
|
3a1503138b | ||
|
|
7486d2ab91 | ||
|
|
82431d8e11 | ||
|
|
20c3d85ba9 | ||
|
|
5051e4aebd | ||
|
|
d3d56ed0ef | ||
|
|
631f801aa6 | ||
|
|
6030610c04 | ||
|
|
9be39b8cd4 | ||
|
|
f2fb8798fa | ||
|
|
449388f3ab | ||
|
|
a3e9bbed25 | ||
|
|
3281c6637d | ||
|
|
c5edbbd004 | ||
|
|
aa765ea4d0 | ||
|
|
307c2c63de | ||
|
|
7d55fd57c9 | ||
|
|
bca586ffd0 | ||
|
|
d359276fe1 | ||
|
|
0b885c5e5f | ||
|
|
4d7ef95d40 | ||
|
|
14a345504f | ||
|
|
4eb5213294 | ||
|
|
9225a3a856 | ||
|
|
b83f36674b | ||
|
|
dfcb104af0 | ||
|
|
3b7ac17410 | ||
|
|
906d52ae0b | ||
|
|
aa9ed05903 | ||
|
|
5213612033 | ||
|
|
518aa1b2a7 | ||
|
|
827bd953e7 | ||
|
|
e54de37242 | ||
|
|
08282a519f | ||
|
|
db7ee2eaf4 | ||
|
|
c7cb750616 | ||
|
|
5903c08c14 | ||
|
|
2babadbc94 | ||
|
|
e397fcc259 | ||
|
|
eee792a019 |
No files matched your search
@@ -1,21 +0,0 @@
|
|||||||
root = true
|
|
||||||
|
|
||||||
[*]
|
|
||||||
end_of_line = lf
|
|
||||||
charset = utf-8
|
|
||||||
insert_final_newline = true
|
|
||||||
trim_trailing_whitespace = true
|
|
||||||
indent_style = tab
|
|
||||||
indent_size = 4
|
|
||||||
|
|
||||||
[{*.md,*_test.go}]
|
|
||||||
indent_style = unset
|
|
||||||
indent_size = unset
|
|
||||||
|
|
||||||
[**/Dockerfile]
|
|
||||||
indent_style = space
|
|
||||||
indent_size = 2
|
|
||||||
|
|
||||||
[*.{yml,yaml,js,json,sh,nuspec}]
|
|
||||||
indent_style = space
|
|
||||||
indent_size = 2
|
|
||||||
@@ -0,0 +1,97 @@
|
|||||||
|
name: release-nightly
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ main ]
|
||||||
|
|
||||||
|
env:
|
||||||
|
GOPATH: /go_path
|
||||||
|
GOCACHE: /go_cache
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
goreleaser:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0 # all history for all branches and tags
|
||||||
|
- uses: actions/setup-go@v3
|
||||||
|
with:
|
||||||
|
go-version: '>=1.20.1'
|
||||||
|
- uses: https://gitea.com/actions/[email protected]
|
||||||
|
id: hash-go
|
||||||
|
with:
|
||||||
|
patterns: |
|
||||||
|
go.mod
|
||||||
|
go.sum
|
||||||
|
- name: cache go
|
||||||
|
id: cache-go
|
||||||
|
uses: https://github.com/actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
/go_path
|
||||||
|
/go_cache
|
||||||
|
key: go_path-${{ steps.hash-go.outputs.hash }}
|
||||||
|
- name: goreleaser
|
||||||
|
uses: https://github.com/goreleaser/goreleaser-action@v4
|
||||||
|
with:
|
||||||
|
distribution: goreleaser-pro
|
||||||
|
version: latest
|
||||||
|
args: release --nightly
|
||||||
|
env:
|
||||||
|
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
|
||||||
|
AWS_REGION: ${{ secrets.AWS_REGION }}
|
||||||
|
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }}
|
||||||
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
|
S3_REGION: ${{ secrets.AWS_REGION }}
|
||||||
|
S3_BUCKET: ${{ secrets.AWS_BUCKET }}
|
||||||
|
release-image:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: catthehacker/ubuntu:act-latest
|
||||||
|
env:
|
||||||
|
DOCKER_ORG: gitea
|
||||||
|
DOCKER_LATEST: nightly
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0 # all history for all branches and tags
|
||||||
|
|
||||||
|
- name: dockerfile lint check
|
||||||
|
uses: https://github.com/hadolint/[email protected]
|
||||||
|
with:
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v2
|
||||||
|
|
||||||
|
- name: Set up Docker BuildX
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
|
- name: Login to DockerHub
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Get Meta
|
||||||
|
id: meta
|
||||||
|
run: |
|
||||||
|
echo REPO_NAME=$(echo ${GITHUB_REPOSITORY} | awk -F"/" '{print $2}') >> $GITHUB_OUTPUT
|
||||||
|
echo REPO_VERSION=$(git describe --tags --always | sed 's/^v//') >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v4
|
||||||
|
env:
|
||||||
|
ACTIONS_RUNTIME_TOKEN: '' # See https://gitea.com/gitea/act_runner/issues/119
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ./Dockerfile
|
||||||
|
platforms: |
|
||||||
|
linux/amd64
|
||||||
|
linux/arm64
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }}:${{ env.DOCKER_LATEST }}
|
||||||
|
|
||||||
@@ -0,0 +1,108 @@
|
|||||||
|
name: release-tag
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- '*'
|
||||||
|
|
||||||
|
env:
|
||||||
|
GOPATH: /go_path
|
||||||
|
GOCACHE: /go_cache
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
goreleaser:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0 # all history for all branches and tags
|
||||||
|
- uses: actions/setup-go@v3
|
||||||
|
with:
|
||||||
|
go-version: '>=1.20.1'
|
||||||
|
- uses: https://gitea.com/actions/[email protected]
|
||||||
|
id: hash-go
|
||||||
|
with:
|
||||||
|
patterns: |
|
||||||
|
go.mod
|
||||||
|
go.sum
|
||||||
|
- name: cache go
|
||||||
|
id: cache-go
|
||||||
|
uses: https://github.com/actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
/go_path
|
||||||
|
/go_cache
|
||||||
|
key: go_path-${{ steps.hash-go.outputs.hash }}
|
||||||
|
- name: Import GPG key
|
||||||
|
id: import_gpg
|
||||||
|
uses: https://github.com/crazy-max/ghaction-import-gpg@v5
|
||||||
|
with:
|
||||||
|
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
|
||||||
|
passphrase: ${{ secrets.PASSPHRASE }}
|
||||||
|
fingerprint: CC64B1DB67ABBEECAB24B6455FC346329753F4B0
|
||||||
|
- name: goreleaser
|
||||||
|
uses: https://github.com/goreleaser/goreleaser-action@v4
|
||||||
|
with:
|
||||||
|
distribution: goreleaser-pro
|
||||||
|
version: latest
|
||||||
|
args: release
|
||||||
|
env:
|
||||||
|
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
|
||||||
|
AWS_REGION: ${{ secrets.AWS_REGION }}
|
||||||
|
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }}
|
||||||
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
|
S3_REGION: ${{ secrets.AWS_REGION }}
|
||||||
|
S3_BUCKET: ${{ secrets.AWS_BUCKET }}
|
||||||
|
GORELEASER_FORCE_TOKEN: 'gitea'
|
||||||
|
GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
|
||||||
|
release-image:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: catthehacker/ubuntu:act-latest
|
||||||
|
env:
|
||||||
|
DOCKER_ORG: gitea
|
||||||
|
DOCKER_LATEST: latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0 # all history for all branches and tags
|
||||||
|
|
||||||
|
- name: dockerfile lint check
|
||||||
|
uses: https://github.com/hadolint/[email protected]
|
||||||
|
with:
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v2
|
||||||
|
|
||||||
|
- name: Set up Docker BuildX
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
|
- name: Login to DockerHub
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Get Meta
|
||||||
|
id: meta
|
||||||
|
run: |
|
||||||
|
echo REPO_NAME=$(echo ${GITHUB_REPOSITORY} | awk -F"/" '{print $2}') >> $GITHUB_OUTPUT
|
||||||
|
echo REPO_VERSION=$(git describe --tags --always | sed 's/^v//') >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v4
|
||||||
|
env:
|
||||||
|
ACTIONS_RUNTIME_TOKEN: '' # See https://gitea.com/gitea/act_runner/issues/119
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ./Dockerfile
|
||||||
|
platforms: |
|
||||||
|
linux/amd64
|
||||||
|
linux/arm64
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }}:${{ steps.meta.outputs.REPO_VERSION }}
|
||||||
|
${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }}:${{ env.DOCKER_LATEST }}
|
||||||
@@ -3,19 +3,40 @@ on:
|
|||||||
- push
|
- push
|
||||||
- pull_request
|
- pull_request
|
||||||
|
|
||||||
|
env:
|
||||||
|
GOPATH: /go_path
|
||||||
|
GOCACHE: /go_cache
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint:
|
lint:
|
||||||
name: check and test
|
name: check and test
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-go@v5
|
- uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
go-version-file: 'go.mod'
|
go-version: '>=1.20.1'
|
||||||
|
- uses: https://gitea.com/actions/[email protected]
|
||||||
|
id: hash-go
|
||||||
|
with:
|
||||||
|
patterns: |
|
||||||
|
go.mod
|
||||||
|
go.sum
|
||||||
|
- name: cache go
|
||||||
|
id: cache-go
|
||||||
|
uses: https://github.com/actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
/go_path
|
||||||
|
/go_cache
|
||||||
|
key: go_path-${{ steps.hash-go.outputs.hash }}
|
||||||
- name: vet checks
|
- name: vet checks
|
||||||
run: go vet -v ./...
|
run: make vet
|
||||||
- name: build
|
- name: build
|
||||||
run: go build -v ./...
|
run: make build
|
||||||
- name: test
|
- name: test
|
||||||
run: | # Test only the new packages in this fork. Add more packages as needed.
|
run: make test
|
||||||
go test -v ./pkg/jobparser
|
- name: dockerfile lint check
|
||||||
|
uses: https://github.com/hadolint/[email protected]
|
||||||
|
with:
|
||||||
|
dockerfile: Dockerfile
|
||||||
@@ -1 +0,0 @@
|
|||||||
github: cplee
|
|
||||||
@@ -1,88 +0,0 @@
|
|||||||
name: Bug report
|
|
||||||
description: Use this template for reporting bugs/issues.
|
|
||||||
labels:
|
|
||||||
- 'kind/bug'
|
|
||||||
body:
|
|
||||||
- type: markdown
|
|
||||||
attributes:
|
|
||||||
value: |
|
|
||||||
Thanks for taking the time to fill out this bug report!
|
|
||||||
- type: textarea
|
|
||||||
id: act-debug
|
|
||||||
attributes:
|
|
||||||
label: Bug report info
|
|
||||||
render: plain text
|
|
||||||
description: |
|
|
||||||
Output of `act --bug-report`
|
|
||||||
placeholder: |
|
|
||||||
act --bug-report
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
id: act-command
|
|
||||||
attributes:
|
|
||||||
label: Command used with act
|
|
||||||
description: |
|
|
||||||
Please paste your whole command
|
|
||||||
placeholder: |
|
|
||||||
act -P ubuntu-latest=node:12 -v -d ...
|
|
||||||
render: sh
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
id: what-happened
|
|
||||||
attributes:
|
|
||||||
label: Describe issue
|
|
||||||
description: |
|
|
||||||
Also tell us what did you expect to happen?
|
|
||||||
placeholder: |
|
|
||||||
Describe issue
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: input
|
|
||||||
id: repo
|
|
||||||
attributes:
|
|
||||||
label: Link to GitHub repository
|
|
||||||
description: |
|
|
||||||
Provide link to GitHub repository, you can skip it if the repository is private or you don't have it on GitHub, otherwise please provide it as it might help us troubleshoot problem
|
|
||||||
placeholder: |
|
|
||||||
https://github.com/nektos/act
|
|
||||||
validations:
|
|
||||||
required: false
|
|
||||||
- type: textarea
|
|
||||||
id: workflow
|
|
||||||
attributes:
|
|
||||||
label: Workflow content
|
|
||||||
description: |
|
|
||||||
Please paste your **whole** workflow here
|
|
||||||
placeholder: |
|
|
||||||
name: My workflow
|
|
||||||
on: ['push', 'schedule']
|
|
||||||
jobs:
|
|
||||||
test:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
env:
|
|
||||||
KEY: VAL
|
|
||||||
[...]
|
|
||||||
render: yml
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
id: logs
|
|
||||||
attributes:
|
|
||||||
label: Relevant log output
|
|
||||||
description: |
|
|
||||||
Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks. Please verify that the log output doesn't contain any sensitive data.
|
|
||||||
render: sh
|
|
||||||
placeholder: |
|
|
||||||
Use `act -v` for verbose output
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
id: additional-info
|
|
||||||
attributes:
|
|
||||||
label: Additional information
|
|
||||||
placeholder: |
|
|
||||||
Additional information that doesn't fit elsewhere
|
|
||||||
validations:
|
|
||||||
required: false
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
blank_issues_enabled: true
|
|
||||||
contact_links:
|
|
||||||
- name: Start a discussion
|
|
||||||
url: https://github.com/nektos/act/discussions/new
|
|
||||||
about: You can ask for help here!
|
|
||||||
- name: Ask on Gitter
|
|
||||||
url: https://gitter.im/nektos/act
|
|
||||||
about: You can ask for help here!
|
|
||||||
- name: Ask on Gitter (via Matrix)
|
|
||||||
url: https://matrix.to/#/#nektos_act:gitter.im?via=gitter.im&via=matrix.org
|
|
||||||
about: If you prefer Matrix over Gitter
|
|
||||||
- name: Want to contribute to act?
|
|
||||||
url: https://github.com/nektos/act/blob/master/CONTRIBUTING.md
|
|
||||||
about: Be sure to read contributing guidelines!
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
name: Feature request
|
|
||||||
description: Use this template for requesting a feature/enhancement.
|
|
||||||
labels:
|
|
||||||
- 'kind/feature-request'
|
|
||||||
body:
|
|
||||||
- type: markdown
|
|
||||||
attributes:
|
|
||||||
value: |
|
|
||||||
Please note that incompatibility with GitHub Actions should be opened as a bug report, not a new feature.
|
|
||||||
- type: input
|
|
||||||
id: act-version
|
|
||||||
attributes:
|
|
||||||
label: Act version
|
|
||||||
description: |
|
|
||||||
What version of `act` are you using? Version can be obtained via `act --version`
|
|
||||||
If you've built it from source, please provide commit hash
|
|
||||||
placeholder: |
|
|
||||||
act --version
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
id: feature
|
|
||||||
attributes:
|
|
||||||
label: Feature description
|
|
||||||
description: Describe feature that you would like to see
|
|
||||||
placeholder: ...
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
name: Wiki issue
|
|
||||||
description: Report issue/improvement ragarding documentation (wiki)
|
|
||||||
labels:
|
|
||||||
- 'kind/discussion'
|
|
||||||
- 'area/docs'
|
|
||||||
body:
|
|
||||||
- type: markdown
|
|
||||||
attributes:
|
|
||||||
value: |
|
|
||||||
Thanks for taking the time to fill out this issue!
|
|
||||||
- type: textarea
|
|
||||||
id: details
|
|
||||||
attributes:
|
|
||||||
label: Details
|
|
||||||
description: |
|
|
||||||
Describe issue
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
FROM alpine:3.17
|
|
||||||
|
|
||||||
ARG CHOCOVERSION=1.1.0
|
|
||||||
|
|
||||||
RUN apk add --no-cache bash ca-certificates git \
|
|
||||||
&& apk --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing add mono mono-dev \
|
|
||||||
&& cert-sync /etc/ssl/certs/ca-certificates.crt \
|
|
||||||
&& wget "https://github.com/chocolatey/choco/archive/${CHOCOVERSION}.tar.gz" -O- | tar -xzf - \
|
|
||||||
&& cd choco-"${CHOCOVERSION}" \
|
|
||||||
&& chmod +x build.sh zip.sh \
|
|
||||||
&& ./build.sh -v \
|
|
||||||
&& mv ./code_drop/chocolatey/console /opt/chocolatey \
|
|
||||||
&& mkdir -p /opt/chocolatey/lib \
|
|
||||||
&& rm -rf /choco-"${CHOCOVERSION}" \
|
|
||||||
&& apk del mono-dev \
|
|
||||||
&& rm -rf /var/cache/apk/*
|
|
||||||
|
|
||||||
ENV ChocolateyInstall=/opt/chocolatey
|
|
||||||
COPY entrypoint.sh /entrypoint.sh
|
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
name: 'Chocolatey Packager'
|
|
||||||
description: 'Create the choco package and push it'
|
|
||||||
inputs:
|
|
||||||
version:
|
|
||||||
description: 'Version of package'
|
|
||||||
required: false
|
|
||||||
apiKey:
|
|
||||||
description: 'API Key for chocolately'
|
|
||||||
required: false
|
|
||||||
push:
|
|
||||||
description: 'Option for if package is going to be pushed'
|
|
||||||
required: false
|
|
||||||
default: 'false'
|
|
||||||
runs:
|
|
||||||
using: 'docker'
|
|
||||||
image: 'Dockerfile'
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
function choco {
|
|
||||||
mono /opt/chocolatey/choco.exe "$@" --allow-unofficial --nocolor
|
|
||||||
}
|
|
||||||
|
|
||||||
function get_version {
|
|
||||||
local version=${INPUT_VERSION:-$(git describe --tags)}
|
|
||||||
version=(${version//[!0-9.-]/})
|
|
||||||
local version_parts=(${version//-/ })
|
|
||||||
version=${version_parts[0]}
|
|
||||||
if [ ${#version_parts[@]} -gt 1 ]; then
|
|
||||||
version=${version_parts}.${version_parts[1]}
|
|
||||||
fi
|
|
||||||
echo "$version"
|
|
||||||
}
|
|
||||||
|
|
||||||
## Determine the version to pack
|
|
||||||
VERSION=$(get_version)
|
|
||||||
echo "Packing version ${VERSION} of act"
|
|
||||||
rm -f act-cli.*.nupkg
|
|
||||||
mkdir -p tools
|
|
||||||
cp LICENSE tools/LICENSE.txt
|
|
||||||
cp VERIFICATION tools/VERIFICATION.txt
|
|
||||||
cp dist/act_windows_amd64_v1/act.exe tools/
|
|
||||||
choco pack act-cli.nuspec --version ${VERSION}
|
|
||||||
if [[ "$INPUT_PUSH" == "true" ]]; then
|
|
||||||
choco push act-cli.${VERSION}.nupkg --api-key ${INPUT_APIKEY} -s https://push.chocolatey.org/ --timeout 180
|
|
||||||
fi
|
|
||||||
@@ -1,77 +0,0 @@
|
|||||||
name: 'run-tests'
|
|
||||||
description: 'Runs go test and upload a step summary'
|
|
||||||
inputs:
|
|
||||||
filter:
|
|
||||||
description: 'The go test pattern for the tests to run'
|
|
||||||
required: false
|
|
||||||
default: ''
|
|
||||||
upload-logs-name:
|
|
||||||
description: 'Choose the name of the log artifact'
|
|
||||||
required: false
|
|
||||||
default: logs-${{ github.job }}-${{ strategy.job-index }}
|
|
||||||
upload-logs:
|
|
||||||
description: 'If true uploads logs of each tests as an artifact'
|
|
||||||
required: false
|
|
||||||
default: 'true'
|
|
||||||
runs:
|
|
||||||
using: composite
|
|
||||||
steps:
|
|
||||||
- uses: actions/github-script@v6
|
|
||||||
with:
|
|
||||||
github-token: none # No reason to grant access to the GITHUB_TOKEN
|
|
||||||
script: |
|
|
||||||
let myOutput = '';
|
|
||||||
var fs = require('fs');
|
|
||||||
var uploadLogs = process.env.UPLOAD_LOGS === 'true';
|
|
||||||
if(uploadLogs) {
|
|
||||||
await io.mkdirP('logs');
|
|
||||||
}
|
|
||||||
var filename = null;
|
|
||||||
const options = {};
|
|
||||||
options.ignoreReturnCode = true;
|
|
||||||
options.env = Object.assign({}, process.env);
|
|
||||||
delete options.env.ACTIONS_RUNTIME_URL;
|
|
||||||
delete options.env.ACTIONS_RUNTIME_TOKEN;
|
|
||||||
delete options.env.ACTIONS_CACHE_URL;
|
|
||||||
options.listeners = {
|
|
||||||
stdout: (data) => {
|
|
||||||
for(line of data.toString().split('\n')) {
|
|
||||||
if(/^\s*(===\s[^\s]+\s|---\s[^\s]+:\s)/.test(line)) {
|
|
||||||
if(uploadLogs) {
|
|
||||||
var runprefix = "=== RUN ";
|
|
||||||
if(line.startsWith(runprefix)) {
|
|
||||||
filename = "logs/" + line.substring(runprefix.length).replace(/[^A-Za-z0-9]/g, '-') + ".txt";
|
|
||||||
fs.writeFileSync(filename, line + "\n");
|
|
||||||
} else if(filename) {
|
|
||||||
fs.appendFileSync(filename, line + "\n");
|
|
||||||
filename = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
myOutput += line + "\n";
|
|
||||||
} else if(filename) {
|
|
||||||
fs.appendFileSync(filename, line + "\n");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
var args = ['test', '-v', '-cover', '-coverprofile=coverage.txt', '-covermode=atomic', '-timeout', '20m'];
|
|
||||||
var filter = process.env.FILTER;
|
|
||||||
if(filter) {
|
|
||||||
args.push('-run');
|
|
||||||
args.push(filter);
|
|
||||||
}
|
|
||||||
args.push('./...');
|
|
||||||
var exitcode = await exec.exec('go', args, options);
|
|
||||||
if(process.env.GITHUB_STEP_SUMMARY) {
|
|
||||||
core.summary.addCodeBlock(myOutput);
|
|
||||||
await core.summary.write();
|
|
||||||
}
|
|
||||||
process.exit(exitcode);
|
|
||||||
env:
|
|
||||||
FILTER: ${{ inputs.filter }}
|
|
||||||
UPLOAD_LOGS: ${{ inputs.upload-logs }}
|
|
||||||
- uses: actions/upload-artifact@v3
|
|
||||||
if: always() && inputs.upload-logs == 'true' && !env.ACT
|
|
||||||
with:
|
|
||||||
name: ${{ inputs.upload-logs-name }}
|
|
||||||
path: logs
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
# To get started with Dependabot version updates, you'll need to specify which
|
|
||||||
# package ecosystems to update and where the package manifests are located.
|
|
||||||
# Please see the documentation for all configuration options:
|
|
||||||
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
|
||||||
|
|
||||||
version: 2
|
|
||||||
updates:
|
|
||||||
- package-ecosystem: 'github-actions'
|
|
||||||
directory: '/'
|
|
||||||
schedule:
|
|
||||||
interval: 'weekly'
|
|
||||||
- package-ecosystem: 'gomod'
|
|
||||||
directory: '/'
|
|
||||||
schedule:
|
|
||||||
interval: 'weekly'
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
test-*.yml
|
|
||||||
@@ -1,181 +0,0 @@
|
|||||||
name: checks
|
|
||||||
on: [pull_request, workflow_dispatch]
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
cancel-in-progress: true
|
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
|
||||||
|
|
||||||
env:
|
|
||||||
ACT_OWNER: ${{ github.repository_owner }}
|
|
||||||
ACT_REPOSITORY: ${{ github.repository }}
|
|
||||||
CGO_ENABLED: 0
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
lint:
|
|
||||||
name: lint
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- uses: actions/setup-go@v5
|
|
||||||
with:
|
|
||||||
go-version-file: go.mod
|
|
||||||
check-latest: true
|
|
||||||
- uses: golangci/[email protected]
|
|
||||||
with:
|
|
||||||
version: v1.53
|
|
||||||
only-new-issues: true
|
|
||||||
- uses: megalinter/megalinter/flavors/[email protected]
|
|
||||||
env:
|
|
||||||
DEFAULT_BRANCH: master
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
VALIDATE_ALL_CODEBASE: false
|
|
||||||
GITHUB_STATUS_REPORTER: ${{ !env.ACT }}
|
|
||||||
GITHUB_COMMENT_REPORTER: ${{ !env.ACT }}
|
|
||||||
|
|
||||||
test-linux:
|
|
||||||
name: test-linux
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 2
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v3
|
|
||||||
- uses: actions/setup-go@v5
|
|
||||||
with:
|
|
||||||
go-version-file: go.mod
|
|
||||||
check-latest: true
|
|
||||||
- uses: actions/cache@v3
|
|
||||||
if: ${{ !env.ACT }}
|
|
||||||
with:
|
|
||||||
path: ~/go/pkg/mod
|
|
||||||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-go-
|
|
||||||
- name: Run Tests
|
|
||||||
uses: ./.github/actions/run-tests
|
|
||||||
with:
|
|
||||||
upload-logs-name: logs-linux
|
|
||||||
- name: Run act from cli
|
|
||||||
run: go run main.go -P ubuntu-latest=node:16-buster-slim -C ./pkg/runner/testdata/ -W ./basic/push.yml
|
|
||||||
- name: Upload Codecov report
|
|
||||||
uses: codecov/[email protected]
|
|
||||||
with:
|
|
||||||
files: coverage.txt
|
|
||||||
fail_ci_if_error: true # optional (default = false)
|
|
||||||
|
|
||||||
test-host:
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
os:
|
|
||||||
- windows-latest
|
|
||||||
- macos-latest
|
|
||||||
name: test-${{matrix.os}}
|
|
||||||
runs-on: ${{matrix.os}}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 2
|
|
||||||
- uses: actions/setup-go@v5
|
|
||||||
with:
|
|
||||||
go-version-file: go.mod
|
|
||||||
check-latest: true
|
|
||||||
- name: Run Tests
|
|
||||||
uses: ./.github/actions/run-tests
|
|
||||||
with:
|
|
||||||
filter: '^TestRunEventHostEnvironment$'
|
|
||||||
upload-logs-name: logs-${{ matrix.os }}
|
|
||||||
|
|
||||||
snapshot:
|
|
||||||
name: snapshot
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: actions/setup-go@v5
|
|
||||||
with:
|
|
||||||
go-version-file: go.mod
|
|
||||||
check-latest: true
|
|
||||||
- uses: actions/cache@v3
|
|
||||||
if: ${{ !env.ACT }}
|
|
||||||
with:
|
|
||||||
path: ~/go/pkg/mod
|
|
||||||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-go-
|
|
||||||
- name: GoReleaser
|
|
||||||
uses: goreleaser/goreleaser-action@v5
|
|
||||||
with:
|
|
||||||
version: latest
|
|
||||||
args: release --snapshot --clean
|
|
||||||
- name: Capture x86_64 (64-bit) Linux binary
|
|
||||||
if: ${{ !env.ACT }}
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: act-linux-amd64
|
|
||||||
path: dist/act_linux_amd64_v1/act
|
|
||||||
- name: Capture i386 (32-bit) Linux binary
|
|
||||||
if: ${{ !env.ACT }}
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: act-linux-i386
|
|
||||||
path: dist/act_linux_386/act
|
|
||||||
- name: Capture arm64 (64-bit) Linux binary
|
|
||||||
if: ${{ !env.ACT }}
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: act-linux-arm64
|
|
||||||
path: dist/act_linux_arm64/act
|
|
||||||
- name: Capture armv6 (32-bit) Linux binary
|
|
||||||
if: ${{ !env.ACT }}
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: act-linux-armv6
|
|
||||||
path: dist/act_linux_arm_6/act
|
|
||||||
- name: Capture armv7 (32-bit) Linux binary
|
|
||||||
if: ${{ !env.ACT }}
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: act-linux-armv7
|
|
||||||
path: dist/act_linux_arm_7/act
|
|
||||||
- name: Capture x86_64 (64-bit) Windows binary
|
|
||||||
if: ${{ !env.ACT }}
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: act-windows-amd64
|
|
||||||
path: dist/act_windows_amd64_v1/act.exe
|
|
||||||
- name: Capture i386 (32-bit) Windows binary
|
|
||||||
if: ${{ !env.ACT }}
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: act-windows-i386
|
|
||||||
path: dist/act_windows_386/act.exe
|
|
||||||
- name: Capture arm64 (64-bit) Windows binary
|
|
||||||
if: ${{ !env.ACT }}
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: act-windows-arm64
|
|
||||||
path: dist/act_windows_arm64/act.exe
|
|
||||||
- name: Capture armv7 (32-bit) Windows binary
|
|
||||||
if: ${{ !env.ACT }}
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: act-windows-armv7
|
|
||||||
path: dist/act_windows_arm_7/act.exe
|
|
||||||
- name: Capture x86_64 (64-bit) MacOS binary
|
|
||||||
if: ${{ !env.ACT }}
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: act-macos-amd64
|
|
||||||
path: dist/act_darwin_amd64_v1/act
|
|
||||||
- name: Capture arm64 (64-bit) MacOS binary
|
|
||||||
if: ${{ !env.ACT }}
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: act-macos-arm64
|
|
||||||
path: dist/act_darwin_arm64/act
|
|
||||||
- name: Chocolatey
|
|
||||||
uses: ./.github/actions/choco
|
|
||||||
with:
|
|
||||||
version: v0.0.0-pr
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
name: promote
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: '0 2 1 * *'
|
|
||||||
workflow_dispatch: {}
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
release:
|
|
||||||
name: promote
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
ref: master
|
|
||||||
token: ${{ secrets.GORELEASER_GITHUB_TOKEN }}
|
|
||||||
- uses: fregante/setup-git-user@v2
|
|
||||||
- uses: actions/setup-go@v5
|
|
||||||
with:
|
|
||||||
go-version-file: go.mod
|
|
||||||
check-latest: true
|
|
||||||
- uses: actions/cache@v3
|
|
||||||
if: ${{ !env.ACT }}
|
|
||||||
with:
|
|
||||||
path: ~/go/pkg/mod
|
|
||||||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-go-
|
|
||||||
- run: make promote
|
|
||||||
@@ -1,61 +0,0 @@
|
|||||||
name: release
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- v*
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
release:
|
|
||||||
name: release
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- uses: actions/setup-go@v5
|
|
||||||
with:
|
|
||||||
go-version-file: go.mod
|
|
||||||
check-latest: true
|
|
||||||
- uses: actions/cache@v3
|
|
||||||
if: ${{ !env.ACT }}
|
|
||||||
with:
|
|
||||||
path: ~/go/pkg/mod
|
|
||||||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-go-
|
|
||||||
- name: GoReleaser
|
|
||||||
uses: goreleaser/goreleaser-action@v5
|
|
||||||
with:
|
|
||||||
version: latest
|
|
||||||
args: release --clean
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }}
|
|
||||||
- name: Winget
|
|
||||||
uses: vedantmgoyal2009/winget-releaser@v2
|
|
||||||
with:
|
|
||||||
identifier: nektos.act
|
|
||||||
installers-regex: '_Windows_\w+\.zip$'
|
|
||||||
token: ${{ secrets.WINGET_TOKEN }}
|
|
||||||
- name: Chocolatey
|
|
||||||
uses: ./.github/actions/choco
|
|
||||||
with:
|
|
||||||
version: ${{ github.ref }}
|
|
||||||
apiKey: ${{ secrets.CHOCO_APIKEY }}
|
|
||||||
push: true
|
|
||||||
- name: GitHub CLI extension
|
|
||||||
uses: actions/github-script@v7
|
|
||||||
with:
|
|
||||||
github-token: ${{ secrets.GORELEASER_GITHUB_TOKEN }}
|
|
||||||
script: |
|
|
||||||
const mainRef = (await github.rest.git.getRef({
|
|
||||||
owner: 'nektos',
|
|
||||||
repo: 'gh-act',
|
|
||||||
ref: 'heads/main',
|
|
||||||
})).data;
|
|
||||||
console.log(mainRef);
|
|
||||||
github.rest.git.createRef({
|
|
||||||
owner: 'nektos',
|
|
||||||
repo: 'gh-act',
|
|
||||||
ref: context.ref,
|
|
||||||
sha: mainRef.object.sha,
|
|
||||||
});
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
name: 'Close stale issues'
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: '0 0 * * *'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
stale:
|
|
||||||
name: Stale
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/stale@v9
|
|
||||||
with:
|
|
||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
stale-issue-message: 'Issue is stale and will be closed in 14 days unless there is new activity'
|
|
||||||
stale-pr-message: 'PR is stale and will be closed in 14 days unless there is new activity'
|
|
||||||
stale-issue-label: 'stale'
|
|
||||||
exempt-issue-labels: 'stale-exempt,kind/feature-request'
|
|
||||||
stale-pr-label: 'stale'
|
|
||||||
exempt-pr-labels: 'stale-exempt'
|
|
||||||
remove-stale-when-updated: 'True'
|
|
||||||
operations-per-run: 500
|
|
||||||
days-before-stale: 180
|
|
||||||
days-before-close: 14
|
|
||||||
+10
-32
@@ -1,34 +1,12 @@
|
|||||||
# Binaries for programs and plugins
|
act_runner
|
||||||
*.exe
|
|
||||||
*.exe~
|
|
||||||
*.dll
|
|
||||||
*.so
|
|
||||||
*.dylib
|
|
||||||
|
|
||||||
# Test binary, build with `go test -c`
|
|
||||||
*.test
|
|
||||||
|
|
||||||
# Output of the go coverage tool, specifically when used with LiteIDE
|
|
||||||
*.out
|
|
||||||
|
|
||||||
/dist/
|
|
||||||
.todo
|
|
||||||
|
|
||||||
*.nupkg
|
|
||||||
.vscode/
|
|
||||||
.idea/
|
|
||||||
|
|
||||||
# Path for actions cache created when running tests
|
|
||||||
pkg/runner/act/
|
|
||||||
|
|
||||||
# act binary
|
|
||||||
dist/local/act
|
|
||||||
|
|
||||||
coverage.txt
|
|
||||||
|
|
||||||
.env
|
.env
|
||||||
.secrets
|
.runner
|
||||||
|
coverage.txt
|
||||||
|
/gitea-vet
|
||||||
|
/config.yaml
|
||||||
|
|
||||||
# megalinter
|
# MS VSCode
|
||||||
report/
|
.vscode
|
||||||
act
|
__debug_bin
|
||||||
|
# gorelease binary folder
|
||||||
|
dist
|
||||||
@@ -1 +0,0 @@
|
|||||||
b910a42edfab7a02b08a52ecef203fd419725642:pkg/container/testdata/docker-pull-options/config.json:generic-api-key:4
|
|
||||||
+161
-40
@@ -1,51 +1,172 @@
|
|||||||
# Minimum golangci-lint version required: v1.46.0
|
linters:
|
||||||
run:
|
enable:
|
||||||
timeout: 3m
|
- gosimple
|
||||||
|
- deadcode
|
||||||
|
- typecheck
|
||||||
|
- govet
|
||||||
|
- errcheck
|
||||||
|
- staticcheck
|
||||||
|
- unused
|
||||||
|
- structcheck
|
||||||
|
- varcheck
|
||||||
|
- dupl
|
||||||
|
#- gocyclo # The cyclomatic complexety of a lot of functions is too high, we should refactor those another time.
|
||||||
|
- gofmt
|
||||||
|
- misspell
|
||||||
|
- gocritic
|
||||||
|
- bidichk
|
||||||
|
- ineffassign
|
||||||
|
- revive
|
||||||
|
- gofumpt
|
||||||
|
- depguard
|
||||||
|
- nakedret
|
||||||
|
- unconvert
|
||||||
|
- wastedassign
|
||||||
|
- nolintlint
|
||||||
|
- stylecheck
|
||||||
|
enable-all: false
|
||||||
|
disable-all: true
|
||||||
|
fast: false
|
||||||
|
|
||||||
skip-dirs:
|
run:
|
||||||
- report # megalinter results+fixes
|
go: 1.18
|
||||||
|
timeout: 10m
|
||||||
|
skip-dirs:
|
||||||
|
- node_modules
|
||||||
|
- public
|
||||||
|
- web_src
|
||||||
|
|
||||||
linters-settings:
|
linters-settings:
|
||||||
gocyclo:
|
stylecheck:
|
||||||
# minimal code complexity to report, 30 by default (but we recommend 10-20)
|
checks: ["all", "-ST1005", "-ST1003"]
|
||||||
min-complexity: 15
|
nakedret:
|
||||||
|
max-func-lines: 0
|
||||||
gocritic:
|
gocritic:
|
||||||
disabled-checks:
|
disabled-checks:
|
||||||
- ifElseChain
|
- ifElseChain
|
||||||
importas:
|
- singleCaseSwitch # Every time this occurred in the code, there was no other way.
|
||||||
aliases:
|
revive:
|
||||||
- pkg: 'github.com/sirupsen/logrus'
|
ignore-generated-header: false
|
||||||
alias: log
|
severity: warning
|
||||||
- pkg: 'github.com/stretchr/testify/assert'
|
confidence: 0.8
|
||||||
alias: assert
|
errorCode: 1
|
||||||
depguard:
|
warningCode: 1
|
||||||
rules:
|
rules:
|
||||||
main:
|
- name: blank-imports
|
||||||
deny:
|
- name: context-as-argument
|
||||||
- pkg: github.com/pkg/errors
|
- name: context-keys-type
|
||||||
desc: Please use "errors" package from standard library
|
- name: dot-imports
|
||||||
- pkg: gotest.tools/v3
|
- name: error-return
|
||||||
desc: Please keep tests unified using only github.com/stretchr/testify
|
- name: error-strings
|
||||||
- pkg: log
|
- name: error-naming
|
||||||
desc: Please keep logging unified using only github.com/sirupsen/logrus
|
- name: exported
|
||||||
linters:
|
- name: if-return
|
||||||
enable:
|
- name: increment-decrement
|
||||||
- megacheck
|
- name: var-naming
|
||||||
- govet
|
- name: var-declaration
|
||||||
- revive
|
- name: package-comments
|
||||||
|
- name: range
|
||||||
|
- name: receiver-naming
|
||||||
|
- name: time-naming
|
||||||
|
- name: unexported-return
|
||||||
|
- name: indent-error-flow
|
||||||
|
- name: errorf
|
||||||
|
- name: duplicated-imports
|
||||||
|
- name: modifies-value-receiver
|
||||||
|
gofumpt:
|
||||||
|
extra-rules: true
|
||||||
|
lang-version: "1.18"
|
||||||
|
depguard:
|
||||||
|
# TODO: use depguard to replace import checks in gitea-vet
|
||||||
|
list-type: denylist
|
||||||
|
# Check the list against standard lib.
|
||||||
|
include-go-root: true
|
||||||
|
packages-with-error-message:
|
||||||
|
- github.com/unknwon/com: "use gitea's util and replacements"
|
||||||
|
|
||||||
|
issues:
|
||||||
|
exclude-rules:
|
||||||
|
# Exclude some linters from running on tests files.
|
||||||
|
- path: _test\.go
|
||||||
|
linters:
|
||||||
- gocyclo
|
- gocyclo
|
||||||
- gosec
|
- errcheck
|
||||||
- unconvert
|
|
||||||
- dupl
|
- dupl
|
||||||
- nakedret
|
- gosec
|
||||||
- prealloc
|
- unparam
|
||||||
- exportloopref
|
- staticcheck
|
||||||
|
- path: models/migrations/v
|
||||||
|
linters:
|
||||||
|
- gocyclo
|
||||||
|
- errcheck
|
||||||
|
- dupl
|
||||||
|
- gosec
|
||||||
|
- linters:
|
||||||
|
- dupl
|
||||||
|
text: "webhook"
|
||||||
|
- linters:
|
||||||
- gocritic
|
- gocritic
|
||||||
- goimports
|
text: "`ID' should not be capitalized"
|
||||||
- whitespace
|
- path: modules/templates/helper.go
|
||||||
|
linters:
|
||||||
|
- gocritic
|
||||||
|
- linters:
|
||||||
|
- unused
|
||||||
|
- deadcode
|
||||||
|
text: "swagger"
|
||||||
|
- path: contrib/pr/checkout.go
|
||||||
|
linters:
|
||||||
|
- errcheck
|
||||||
|
- path: models/issue.go
|
||||||
|
linters:
|
||||||
|
- errcheck
|
||||||
|
- path: models/migrations/
|
||||||
|
linters:
|
||||||
|
- errcheck
|
||||||
|
- path: modules/log/
|
||||||
|
linters:
|
||||||
|
- errcheck
|
||||||
|
- path: routers/api/v1/repo/issue_subscription.go
|
||||||
|
linters:
|
||||||
|
- dupl
|
||||||
|
- path: routers/repo/view.go
|
||||||
|
linters:
|
||||||
|
- dupl
|
||||||
|
- path: models/migrations/
|
||||||
|
linters:
|
||||||
|
- unused
|
||||||
|
- linters:
|
||||||
|
- staticcheck
|
||||||
|
text: "argument x is overwritten before first use"
|
||||||
|
- path: modules/httplib/httplib.go
|
||||||
|
linters:
|
||||||
|
- staticcheck
|
||||||
|
# Enabling this would require refactoring the methods and how they are called.
|
||||||
|
- path: models/issue_comment_list.go
|
||||||
|
linters:
|
||||||
|
- dupl
|
||||||
|
- linters:
|
||||||
- misspell
|
- misspell
|
||||||
- depguard
|
text: '`Unknwon` is a misspelling of `Unknown`'
|
||||||
- importas
|
- path: models/update.go
|
||||||
- contextcheck
|
linters:
|
||||||
- nolintlint
|
- unused
|
||||||
- revive
|
- path: cmd/dump.go
|
||||||
|
linters:
|
||||||
|
- dupl
|
||||||
|
- path: services/webhook/webhook.go
|
||||||
|
linters:
|
||||||
|
- structcheck
|
||||||
|
- text: "commentFormatting: put a space between `//` and comment text"
|
||||||
|
linters:
|
||||||
|
- gocritic
|
||||||
|
- text: "exitAfterDefer:"
|
||||||
|
linters:
|
||||||
|
- gocritic
|
||||||
|
- path: modules/graceful/manager_windows.go
|
||||||
|
linters:
|
||||||
|
- staticcheck
|
||||||
|
text: "svc.IsAnInteractiveSession is deprecated: Use IsWindowsService instead."
|
||||||
|
- path: models/user/openid.go
|
||||||
|
linters:
|
||||||
|
- golint
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
if [ -z "$1" ]; then
|
||||||
|
echo "usage: $0 <path>"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
SUM=$(shasum -a 256 "$1" | cut -d' ' -f1)
|
||||||
|
BASENAME=$(basename "$1")
|
||||||
|
echo -n "${SUM} ${BASENAME}" > "$1".sha256
|
||||||
@@ -0,0 +1,115 @@
|
|||||||
|
before:
|
||||||
|
hooks:
|
||||||
|
- go mod tidy
|
||||||
|
|
||||||
|
builds:
|
||||||
|
- env:
|
||||||
|
- CGO_ENABLED=0
|
||||||
|
goos:
|
||||||
|
- darwin
|
||||||
|
- linux
|
||||||
|
- windows
|
||||||
|
- freebsd
|
||||||
|
goarch:
|
||||||
|
- amd64
|
||||||
|
- arm
|
||||||
|
- arm64
|
||||||
|
goarm:
|
||||||
|
- "5"
|
||||||
|
- "6"
|
||||||
|
- "7"
|
||||||
|
ignore:
|
||||||
|
- goos: darwin
|
||||||
|
goarch: arm
|
||||||
|
- goos: darwin
|
||||||
|
goarch: ppc64le
|
||||||
|
- goos: darwin
|
||||||
|
goarch: s390x
|
||||||
|
- goos: windows
|
||||||
|
goarch: ppc64le
|
||||||
|
- goos: windows
|
||||||
|
goarch: s390x
|
||||||
|
- goos: windows
|
||||||
|
goarch: arm
|
||||||
|
goarm: "5"
|
||||||
|
- goos: windows
|
||||||
|
goarch: arm
|
||||||
|
goarm: "6"
|
||||||
|
- goos: windows
|
||||||
|
goarch: arm
|
||||||
|
goarm: "7"
|
||||||
|
- goos: windows
|
||||||
|
goarch: arm64
|
||||||
|
- goos: freebsd
|
||||||
|
goarch: ppc64le
|
||||||
|
- goos: freebsd
|
||||||
|
goarch: s390x
|
||||||
|
- goos: freebsd
|
||||||
|
goarch: arm
|
||||||
|
goarm: "5"
|
||||||
|
- goos: freebsd
|
||||||
|
goarch: arm
|
||||||
|
goarm: "6"
|
||||||
|
- goos: freebsd
|
||||||
|
goarch: arm
|
||||||
|
goarm: "7"
|
||||||
|
- goos: freebsd
|
||||||
|
goarch: arm64
|
||||||
|
flags:
|
||||||
|
- -trimpath
|
||||||
|
ldflags:
|
||||||
|
- -s -w -X gitea.com/gitea/act_runner/internal/pkg/ver.version={{ .Summary }}
|
||||||
|
binary: >-
|
||||||
|
{{ .ProjectName }}-
|
||||||
|
{{- .Version }}-
|
||||||
|
{{- .Os }}-
|
||||||
|
{{- if eq .Arch "amd64" }}amd64
|
||||||
|
{{- else if eq .Arch "amd64_v1" }}amd64
|
||||||
|
{{- else if eq .Arch "386" }}386
|
||||||
|
{{- else }}{{ .Arch }}{{ end }}
|
||||||
|
{{- if .Arm }}-{{ .Arm }}{{ end }}
|
||||||
|
no_unique_dist_dir: true
|
||||||
|
hooks:
|
||||||
|
post:
|
||||||
|
- cmd: xz -k -9 {{ .Path }}
|
||||||
|
dir: ./dist/
|
||||||
|
- cmd: sh .goreleaser.checksum.sh {{ .Path }}
|
||||||
|
- cmd: sh .goreleaser.checksum.sh {{ .Path }}.xz
|
||||||
|
|
||||||
|
blobs:
|
||||||
|
-
|
||||||
|
provider: s3
|
||||||
|
bucket: "{{ .Env.S3_BUCKET }}"
|
||||||
|
region: "{{ .Env.S3_REGION }}"
|
||||||
|
folder: "act_runner/{{.Version}}"
|
||||||
|
extra_files:
|
||||||
|
- glob: ./**.xz
|
||||||
|
- glob: ./**.sha256
|
||||||
|
|
||||||
|
archives:
|
||||||
|
- format: binary
|
||||||
|
name_template: "{{ .Binary }}"
|
||||||
|
allow_different_binary_count: true
|
||||||
|
|
||||||
|
checksum:
|
||||||
|
name_template: 'checksums.txt'
|
||||||
|
extra_files:
|
||||||
|
- glob: ./**.xz
|
||||||
|
|
||||||
|
snapshot:
|
||||||
|
name_template: "{{ .Branch }}-devel"
|
||||||
|
|
||||||
|
nightly:
|
||||||
|
name_template: "nightly"
|
||||||
|
|
||||||
|
gitea_urls:
|
||||||
|
api: https://gitea.com/api/v1
|
||||||
|
download: https://gitea.com
|
||||||
|
|
||||||
|
release:
|
||||||
|
extra_files:
|
||||||
|
- glob: ./**.xz
|
||||||
|
- glob: ./**.xz.sha256
|
||||||
|
|
||||||
|
# yaml-language-server: $schema=https://goreleaser.com/static/schema-pro.json
|
||||||
|
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
before:
|
|
||||||
hooks:
|
|
||||||
- go mod tidy
|
|
||||||
builds:
|
|
||||||
- env:
|
|
||||||
- CGO_ENABLED=0
|
|
||||||
goos:
|
|
||||||
- darwin
|
|
||||||
- linux
|
|
||||||
- windows
|
|
||||||
goarch:
|
|
||||||
- amd64
|
|
||||||
- '386'
|
|
||||||
- arm64
|
|
||||||
- arm
|
|
||||||
goarm:
|
|
||||||
- '6'
|
|
||||||
- '7'
|
|
||||||
ignore:
|
|
||||||
- goos: windows
|
|
||||||
goarm: '6'
|
|
||||||
checksum:
|
|
||||||
name_template: 'checksums.txt'
|
|
||||||
archives:
|
|
||||||
- name_template: >-
|
|
||||||
{{ .ProjectName }}_
|
|
||||||
{{- title .Os }}_
|
|
||||||
{{- if eq .Arch "amd64" }}x86_64
|
|
||||||
{{- else if eq .Arch "386" }}i386
|
|
||||||
{{- else }}{{ .Arch }}{{ end }}
|
|
||||||
{{- if .Arm }}v{{ .Arm }}{{ end }}
|
|
||||||
format_overrides:
|
|
||||||
- goos: windows
|
|
||||||
format: zip
|
|
||||||
changelog:
|
|
||||||
groups:
|
|
||||||
- title: 'New Features'
|
|
||||||
regexp: "^.*feat[(\\w)]*:+.*$"
|
|
||||||
order: 0
|
|
||||||
- title: 'Bug fixes'
|
|
||||||
regexp: "^.*fix[(\\w)]*:+.*$"
|
|
||||||
order: 1
|
|
||||||
- title: 'Documentation updates'
|
|
||||||
regexp: "^.*docs[(\\w)]*:+.*$"
|
|
||||||
order: 2
|
|
||||||
- title: 'Other'
|
|
||||||
order: 999
|
|
||||||
release:
|
|
||||||
prerelease: auto
|
|
||||||
mode: append
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
# Default state for all rules
|
|
||||||
default: true
|
|
||||||
|
|
||||||
# MD013/line-length - Line length
|
|
||||||
MD013:
|
|
||||||
line_length: 1024
|
|
||||||
|
|
||||||
# MD033/no-inline-html - Inline HTML
|
|
||||||
MD033: false
|
|
||||||
|
|
||||||
# MD041/first-line-heading/first-line-h1 - First line in a file should be a top-level heading
|
|
||||||
MD041: false
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
---
|
|
||||||
APPLY_FIXES: none
|
|
||||||
DISABLE:
|
|
||||||
- ACTION
|
|
||||||
- BASH
|
|
||||||
- COPYPASTE
|
|
||||||
- DOCKERFILE
|
|
||||||
- GO
|
|
||||||
- JAVASCRIPT
|
|
||||||
- SPELL
|
|
||||||
DISABLE_LINTERS:
|
|
||||||
- YAML_YAMLLINT
|
|
||||||
- MARKDOWN_MARKDOWN_TABLE_FORMATTER
|
|
||||||
- MARKDOWN_MARKDOWN_LINK_CHECK
|
|
||||||
- REPOSITORY_CHECKOV
|
|
||||||
- REPOSITORY_TRIVY
|
|
||||||
FILTER_REGEX_EXCLUDE: (.*testdata/*|install.sh|pkg/container/docker_cli.go|pkg/container/DOCKER_LICENSE|VERSION)
|
|
||||||
MARKDOWN_MARKDOWNLINT_CONFIG_FILE: .markdownlint.yml
|
|
||||||
PARALLEL: false
|
|
||||||
PRINT_ALPACA: false
|
|
||||||
@@ -1,97 +0,0 @@
|
|||||||
pull_request_rules:
|
|
||||||
- name: warn on conflicts
|
|
||||||
conditions:
|
|
||||||
- -draft
|
|
||||||
- -closed
|
|
||||||
- -merged
|
|
||||||
- conflict
|
|
||||||
actions:
|
|
||||||
comment:
|
|
||||||
message: '@{{author}} this pull request is now in conflict 😩'
|
|
||||||
label:
|
|
||||||
add:
|
|
||||||
- conflict
|
|
||||||
- name: remove conflict label if not needed
|
|
||||||
conditions:
|
|
||||||
- -conflict
|
|
||||||
actions:
|
|
||||||
label:
|
|
||||||
remove:
|
|
||||||
- conflict
|
|
||||||
- name: warn on needs-work
|
|
||||||
conditions:
|
|
||||||
- -draft
|
|
||||||
- -closed
|
|
||||||
- -merged
|
|
||||||
- or:
|
|
||||||
- check-failure=lint
|
|
||||||
- check-failure=test-linux
|
|
||||||
- check-failure=codecov/patch
|
|
||||||
- check-failure=codecov/project
|
|
||||||
- check-failure=snapshot
|
|
||||||
actions:
|
|
||||||
comment:
|
|
||||||
message: '@{{author}} this pull request has failed checks 🛠'
|
|
||||||
label:
|
|
||||||
add:
|
|
||||||
- needs-work
|
|
||||||
- name: remove needs-work label if not needed
|
|
||||||
conditions:
|
|
||||||
- check-success=lint
|
|
||||||
- check-success=test-linux
|
|
||||||
- check-success=codecov/patch
|
|
||||||
- check-success=codecov/project
|
|
||||||
- check-success=snapshot
|
|
||||||
actions:
|
|
||||||
label:
|
|
||||||
remove:
|
|
||||||
- needs-work
|
|
||||||
- name: Automatic maintainer assignment
|
|
||||||
conditions:
|
|
||||||
- '-approved-reviews-by=@nektos/act-maintainers'
|
|
||||||
- -draft
|
|
||||||
- -merged
|
|
||||||
- -closed
|
|
||||||
- -conflict
|
|
||||||
- check-success=lint
|
|
||||||
- check-success=test-linux
|
|
||||||
- check-success=codecov/patch
|
|
||||||
- check-success=codecov/project
|
|
||||||
- check-success=snapshot
|
|
||||||
actions:
|
|
||||||
request_reviews:
|
|
||||||
teams:
|
|
||||||
- '@nektos/act-maintainers'
|
|
||||||
- name: Automatic merge on approval
|
|
||||||
conditions:
|
|
||||||
- '#changes-requested-reviews-by=0'
|
|
||||||
- or:
|
|
||||||
- 'approved-reviews-by=@nektos/act-committers'
|
|
||||||
- 'author~=^dependabot(|-preview)\[bot\]$'
|
|
||||||
- and:
|
|
||||||
- 'approved-reviews-by=@nektos/act-maintainers'
|
|
||||||
- '#approved-reviews-by>=2'
|
|
||||||
- and:
|
|
||||||
- 'author=@nektos/act-maintainers'
|
|
||||||
- 'approved-reviews-by=@nektos/act-maintainers'
|
|
||||||
- '#approved-reviews-by>=1'
|
|
||||||
- -draft
|
|
||||||
- -merged
|
|
||||||
- -closed
|
|
||||||
- check-success=lint
|
|
||||||
- check-success=test-linux
|
|
||||||
- check-success=codecov/patch
|
|
||||||
- check-success=codecov/project
|
|
||||||
- check-success=snapshot
|
|
||||||
actions:
|
|
||||||
queue:
|
|
||||||
method: squash
|
|
||||||
name: default
|
|
||||||
queue_rules:
|
|
||||||
- name: default
|
|
||||||
conditions:
|
|
||||||
- check-success=lint
|
|
||||||
- check-success=test-linux
|
|
||||||
- check-success=codecov/patch
|
|
||||||
- check-success=codecov/project
|
|
||||||
- check-success=snapshot
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
**/testdata
|
|
||||||
pkg/runner/res
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
overrides:
|
|
||||||
- files: '*.yml'
|
|
||||||
options:
|
|
||||||
singleQuote: true
|
|
||||||
- files: '*.json'
|
|
||||||
options:
|
|
||||||
singleQuote: false
|
|
||||||
Vendored
-9
@@ -1,9 +0,0 @@
|
|||||||
{
|
|
||||||
"recommendations": [
|
|
||||||
"editorconfig.editorconfig",
|
|
||||||
"golang.go",
|
|
||||||
"davidanson.vscode-markdownlint",
|
|
||||||
"esbenp.prettier-vscode",
|
|
||||||
"redhat.vscode-yaml"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
Vendored
-14
@@ -1,14 +0,0 @@
|
|||||||
{
|
|
||||||
"go.lintTool": "golangci-lint",
|
|
||||||
"go.lintFlags": ["--fix"],
|
|
||||||
"go.testTimeout": "300s",
|
|
||||||
"[json]": {
|
|
||||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
||||||
},
|
|
||||||
"[markdown]": {
|
|
||||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
||||||
},
|
|
||||||
"[yaml]": {
|
|
||||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
* @nektos/act-maintainers
|
|
||||||
@@ -1,69 +0,0 @@
|
|||||||
# Contributing to Act
|
|
||||||
|
|
||||||
Help wanted! We'd love your contributions to Act. Please review the following guidelines before contributing. Also, feel free to propose changes to these guidelines by updating this file and submitting a pull request.
|
|
||||||
|
|
||||||
- [I have a question...](#questions)
|
|
||||||
- [I found a bug...](#bugs)
|
|
||||||
- [I have a feature request...](#features)
|
|
||||||
- [I have a contribution to share...](#process)
|
|
||||||
|
|
||||||
## <a id="questions"></a> Have a Question?
|
|
||||||
|
|
||||||
Please don't open a GitHub issue for questions about how to use `act`, as the goal is to use issues for managing bugs and feature requests. Issues that are related to general support will be closed and redirected to our gitter room.
|
|
||||||
|
|
||||||
For all support related questions, please ask the question in our gitter room: [nektos/act](https://gitter.im/nektos/act).
|
|
||||||
|
|
||||||
## <a id="bugs"></a> Found a Bug?
|
|
||||||
|
|
||||||
If you've identified a bug in `act`, please [submit an issue](#issue) to our GitHub repo: [nektos/act](https://github.com/nektos/act/issues/new). Please also feel free to submit a [Pull Request](#pr) with a fix for the bug!
|
|
||||||
|
|
||||||
## <a id="features"></a> Have a Feature Request?
|
|
||||||
|
|
||||||
All feature requests should start with [submitting an issue](#issue) documenting the user story and acceptance criteria. Again, feel free to submit a [Pull Request](#pr) with a proposed implementation of the feature.
|
|
||||||
|
|
||||||
## <a id="process"></a> Ready to Contribute
|
|
||||||
|
|
||||||
### <a id="issue"></a> Create an issue
|
|
||||||
|
|
||||||
Before submitting a new issue, please search the issues to make sure there isn't a similar issue doesn't already exist.
|
|
||||||
|
|
||||||
Assuming no existing issues exist, please ensure you include required information when submitting the issue to ensure we can quickly reproduce your issue.
|
|
||||||
|
|
||||||
We may have additional questions and will communicate through the GitHub issue, so please respond back to our questions to help reproduce and resolve the issue as quickly as possible.
|
|
||||||
|
|
||||||
New issues can be created with in our [GitHub repo](https://github.com/nektos/act/issues/new).
|
|
||||||
|
|
||||||
### <a id="pr"></a>Pull Requests
|
|
||||||
|
|
||||||
Pull requests should target the `master` branch. Please also reference the issue from the description of the pull request using [special keyword syntax](https://help.github.com/articles/closing-issues-via-commit-messages/) to auto close the issue when the PR is merged. For example, include the phrase `fixes #14` in the PR description to have issue #14 auto close. Please send documentation updates for the [act user guide](https://nektosact.com) to [nektos/act-docs](https://github.com/nektos/act-docs).
|
|
||||||
|
|
||||||
### <a id="style"></a> Styleguide
|
|
||||||
|
|
||||||
When submitting code, please make every effort to follow existing conventions and style in order to keep the code as readable as possible. Here are a few points to keep in mind:
|
|
||||||
|
|
||||||
- Please run `go fmt ./...` before committing to ensure code aligns with go standards.
|
|
||||||
- We use [`golangci-lint`](https://golangci-lint.run/) for linting Go code, run `golangci-lint run --fix` before submitting PR. Editors such as Visual Studio Code or JetBrains IntelliJ; with Go support plugin will offer `golangci-lint` automatically.
|
|
||||||
- There are additional linters and formatters for files such as Markdown documents or YAML/JSON:
|
|
||||||
- Please refer to the [Makefile](Makefile) or [`lint` job in our workflow](.github/workflows/checks.yml) to see how to those linters/formatters work.
|
|
||||||
- You can lint codebase by running `go run main.go -j lint --env RUN_LOCAL=true` or `act -j lint --env RUN_LOCAL=true`
|
|
||||||
- In `Makefile`, there are tools that require `npx` which is shipped with `nodejs`.
|
|
||||||
- Our `Makefile` exports `GITHUB_TOKEN` from `~/.config/github/token`, you have been warned.
|
|
||||||
- You can run `make pr` to cleanup dependencies, format/lint code and run tests.
|
|
||||||
- All dependencies must be defined in the `go.mod` file.
|
|
||||||
- Advanced IDEs and code editors (like VSCode) will take care of that, but to be sure, run `go mod tidy` to validate dependencies.
|
|
||||||
- For details on the approved style, check out [Effective Go](https://golang.org/doc/effective_go.html).
|
|
||||||
- Before running tests, please be aware that they are multi-architecture so for them to not fail, you need to run `docker run --privileged --rm tonistiigi/binfmt --install amd64,arm64` before ([more info available in #765](https://github.com/nektos/act/issues/765)).
|
|
||||||
|
|
||||||
Also, consider the original design principles:
|
|
||||||
|
|
||||||
- **Polyglot** - There will be no prescribed language or framework for developing the microservices. The only requirement will be that the service will be run inside a container and exposed via an HTTP endpoint.
|
|
||||||
- **Cloud Provider** - At this point, the tool will assume AWS for the cloud provider and will not be written in a cloud agnostic manner. However, this does not preclude refactoring to add support for other providers at a later time.
|
|
||||||
- **Declarative** - All resource administration will be handled in a declarative vs. imperative manner. A file will be used to declared the desired state of the resources and the tool will simply assert the actual state matches the desired state. The tool will accomplish this by generating CloudFormation templates.
|
|
||||||
- **Stateless** - The tool will not maintain its own state. Rather, it will rely on the CloudFormation stacks to determine the state of the platform.
|
|
||||||
- **Secure** - All security will be managed by AWS IAM credentials. No additional authentication or authorization mechanisms will be introduced.
|
|
||||||
|
|
||||||
### License
|
|
||||||
|
|
||||||
By contributing your code, you agree to license your contribution under the terms of the [MIT License](LICENSE).
|
|
||||||
|
|
||||||
All files are released with the MIT license.
|
|
||||||
+18
@@ -0,0 +1,18 @@
|
|||||||
|
FROM golang:1.20-alpine3.17 as builder
|
||||||
|
# Do not remove `git` here, it is required for getting runner version when executing `make build`
|
||||||
|
RUN apk add --no-cache make=4.3-r1 git=2.38.5-r0
|
||||||
|
|
||||||
|
COPY . /opt/src/act_runner
|
||||||
|
WORKDIR /opt/src/act_runner
|
||||||
|
|
||||||
|
RUN make clean && make build
|
||||||
|
|
||||||
|
FROM alpine:3.17
|
||||||
|
RUN apk add --no-cache \
|
||||||
|
git=2.38.5-r0 bash=5.2.15-r0 tini=0.19.0-r1 \
|
||||||
|
&& rm -rf /var/cache/apk/*
|
||||||
|
|
||||||
|
COPY --from=builder /opt/src/act_runner/act_runner /usr/local/bin/act_runner
|
||||||
|
COPY run.sh /opt/act/run.sh
|
||||||
|
|
||||||
|
ENTRYPOINT ["/sbin/tini","--","/opt/act/run.sh"]
|
||||||
@@ -1,67 +0,0 @@
|
|||||||
# List of Docker images for `act`
|
|
||||||
|
|
||||||
**Warning:** Below badges with size for each image are displaying size of **compressed image size in registry. After pulling the image, size can be drastically different due to Docker uncompressing the image layers.**
|
|
||||||
|
|
||||||
## Images based on [`buildpack-deps`][hub/_/buildpack-deps]
|
|
||||||
|
|
||||||
**Note 1: `node` images are based on Debian root filesystem, while it is extremely similar to Ubuntu, there might be some differences**
|
|
||||||
|
|
||||||
**Note 2: `node` `-slim` images don't have `python` installed, if you want to use actions or software that is depending on `python`, you need to specify image manually**
|
|
||||||
|
|
||||||
| Image | Size |
|
|
||||||
| ------------------------------------- | ---------------------------------------------------------- |
|
|
||||||
| [`node:16-bullseye`][hub/_/node] | ![`bullseye-size`][hub/_/node/16-bullseye/size] |
|
|
||||||
| [`node:16-bullseye-slim`][hub/_/node] | ![`micro-bullseye-size`][hub/_/node/16-bullseye-slim/size] |
|
|
||||||
| [`node:16-buster`][hub/_/node] | ![`buster-size`][hub/_/node/16-buster/size] |
|
|
||||||
| [`node:16-buster-slim`][hub/_/node] | ![`micro-buster-size`][hub/_/node/16-buster-slim/size] |
|
|
||||||
|
|
||||||
**Note: `catthehacker/ubuntu` images are based on Ubuntu root filesystem**
|
|
||||||
|
|
||||||
| Image | GitHub Repository |
|
|
||||||
| ------------------------------------------------------------ | ------------------------------------------------------------- |
|
|
||||||
| [`catthehacker/ubuntu:act-latest`][ghcr/catthehacker/ubuntu] | [`catthehacker/docker-images`][gh/catthehacker/docker_images] |
|
|
||||||
| [`catthehacker/ubuntu:act-22.04`][ghcr/catthehacker/ubuntu] | [`catthehacker/docker-images`][gh/catthehacker/docker_images] |
|
|
||||||
| [`catthehacker/ubuntu:act-20.04`][ghcr/catthehacker/ubuntu] | [`catthehacker/docker-images`][gh/catthehacker/docker_images] |
|
|
||||||
| [`catthehacker/ubuntu:act-18.04`][ghcr/catthehacker/ubuntu] | [`catthehacker/docker-images`][gh/catthehacker/docker_images] |
|
|
||||||
|
|
||||||
## Images based on [`actions/virtual-environments`][gh/actions/virtual-environments]
|
|
||||||
|
|
||||||
**Note: `nektos/act-environments-ubuntu` have been last updated in February, 2020. It's recommended to update the image manually after `docker pull` if you decide to use it.**
|
|
||||||
|
|
||||||
| Image | Size | GitHub Repository |
|
|
||||||
| --------------------------------------------------------------------------------- | -------------------------------------------------------------------------- | ------------------------------------------------------- |
|
|
||||||
| [`nektos/act-environments-ubuntu:18.04`][hub/nektos/act-environments-ubuntu] | ![`nektos:18.04`][hub/nektos/act-environments-ubuntu/18.04/size] | [`nektos/act-environments`][gh/nektos/act-environments] |
|
|
||||||
| [`nektos/act-environments-ubuntu:18.04-lite`][hub/nektos/act-environments-ubuntu] | ![`nektos:18.04-lite`][hub/nektos/act-environments-ubuntu/18.04-lite/size] | [`nektos/act-environments`][gh/nektos/act-environments] |
|
|
||||||
| [`nektos/act-environments-ubuntu:18.04-full`][hub/nektos/act-environments-ubuntu] | ![`nektos:18.04-full`][hub/nektos/act-environments-ubuntu/18.04-full/size] | [`nektos/act-environments`][gh/nektos/act-environments] |
|
|
||||||
|
|
||||||
| Image | GitHub Repository |
|
|
||||||
| ------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
|
|
||||||
| [`catthehacker/ubuntu:full-latest`][ghcr/catthehacker/ubuntu] | [`catthehacker/virtual-environments-fork`][gh/catthehacker/virtual-environments-fork] |
|
|
||||||
| [`catthehacker/ubuntu:full-20.04`][ghcr/catthehacker/ubuntu] | [`catthehacker/virtual-environments-fork`][gh/catthehacker/virtual-environments-fork] |
|
|
||||||
| [`catthehacker/ubuntu:full-18.04`][ghcr/catthehacker/ubuntu] | [`catthehacker/virtual-environments-fork`][gh/catthehacker/virtual-environments-fork] |
|
|
||||||
|
|
||||||
Feel free to make a pull request with your image added here
|
|
||||||
|
|
||||||
[hub/_/buildpack-deps]: https://hub.docker.com/_/buildpack-deps
|
|
||||||
[hub/_/node]: https://hub.docker.com/r/_/node
|
|
||||||
[hub/_/node/16-bullseye/size]: https://img.shields.io/docker/image-size/_/node/16-bullseye
|
|
||||||
[hub/_/node/16-bullseye-slim/size]: https://img.shields.io/docker/image-size/_/node/16-bullseye-slim
|
|
||||||
[hub/_/node/16-buster/size]: https://img.shields.io/docker/image-size/_/node/16-buster
|
|
||||||
[hub/_/node/16-buster-slim/size]: https://img.shields.io/docker/image-size/_/node/16-buster-slim
|
|
||||||
[ghcr/catthehacker/ubuntu]: https://github.com/catthehacker/docker_images/pkgs/container/ubuntu
|
|
||||||
[hub/nektos/act-environments-ubuntu]: https://hub.docker.com/r/nektos/act-environments-ubuntu
|
|
||||||
[hub/nektos/act-environments-ubuntu/18.04/size]: https://img.shields.io/docker/image-size/nektos/act-environments-ubuntu/18.04
|
|
||||||
[hub/nektos/act-environments-ubuntu/18.04-lite/size]: https://img.shields.io/docker/image-size/nektos/act-environments-ubuntu/18.04-lite
|
|
||||||
[hub/nektos/act-environments-ubuntu/18.04-full/size]: https://img.shields.io/docker/image-size/nektos/act-environments-ubuntu/18.04-full
|
|
||||||
|
|
||||||
<!--
|
|
||||||
[hub/<username>/<image>]: https://hub.docker.com/r/[username]/[image]
|
|
||||||
[hub/<username>/<image>/<tag>/size]: https://img.shields.io/docker/image-size/[username]/[image]/[tag]
|
|
||||||
-->
|
|
||||||
|
|
||||||
<!-- GitHub repository links -->
|
|
||||||
|
|
||||||
[gh/nektos/act-environments]: https://github.com/nektos/act-environments
|
|
||||||
[gh/actions/virtual-environments]: https://github.com/actions/virtual-environments
|
|
||||||
[gh/catthehacker/docker_images]: https://github.com/catthehacker/docker_images
|
|
||||||
[gh/catthehacker/virtual-environments-fork]: https://github.com/catthehacker/virtual-environments-fork
|
|
||||||
@@ -1,7 +1,4 @@
|
|||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2022 The Gitea Authors
|
Copyright (c) 2022 The Gitea Authors
|
||||||
Copyright (c) 2019
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
@@ -10,13 +7,13 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|||||||
copies of the Software, and to permit persons to whom the Software is
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
furnished to do so, subject to the following conditions:
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
The above copyright notice and this permission notice shall be included in
|
||||||
copies or substantial portions of the Software.
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
SOFTWARE.
|
THE SOFTWARE.
|
||||||
@@ -1,113 +1,178 @@
|
|||||||
PREFIX ?= /usr/local
|
DIST := dist
|
||||||
VERSION ?= $(shell git describe --tags --dirty --always | sed -e 's/^v//')
|
EXECUTABLE := act_runner
|
||||||
IS_SNAPSHOT = $(if $(findstring -, $(VERSION)),true,false)
|
GOFMT ?= gofumpt -l
|
||||||
MAJOR_VERSION = $(word 1, $(subst ., ,$(VERSION)))
|
DIST := dist
|
||||||
MINOR_VERSION = $(word 2, $(subst ., ,$(VERSION)))
|
DIST_DIRS := $(DIST)/binaries $(DIST)/release
|
||||||
PATCH_VERSION = $(word 3, $(subst ., ,$(word 1,$(subst -, , $(VERSION)))))
|
GO ?= go
|
||||||
NEW_VERSION ?= $(MAJOR_VERSION).$(MINOR_VERSION).$(shell echo $$(( $(PATCH_VERSION) + 1)) )
|
SHASUM ?= shasum -a 256
|
||||||
|
HAS_GO = $(shell hash $(GO) > /dev/null 2>&1 && echo "GO" || echo "NOGO" )
|
||||||
|
XGO_PACKAGE ?= src.techknowlogick.com/xgo@latest
|
||||||
|
XGO_VERSION := go-1.18.x
|
||||||
|
GXZ_PAGAGE ?= github.com/ulikunitz/xz/cmd/[email protected]
|
||||||
|
|
||||||
fix = false
|
LINUX_ARCHS ?= linux/amd64,linux/arm64
|
||||||
ifeq (true,$(fix))
|
DARWIN_ARCHS ?= darwin-12/amd64,darwin-12/arm64
|
||||||
FIX = --fix
|
WINDOWS_ARCHS ?= windows/amd64
|
||||||
|
GO_FMT_FILES := $(shell find . -type f -name "*.go" ! -name "generated.*")
|
||||||
|
GOFILES := $(shell find . -type f -name "*.go" -o -name "go.mod" ! -name "generated.*")
|
||||||
|
|
||||||
|
DOCKER_IMAGE ?= gitea/act_runner
|
||||||
|
DOCKER_TAG ?= nightly
|
||||||
|
DOCKER_REF := $(DOCKER_IMAGE):$(DOCKER_TAG)
|
||||||
|
|
||||||
|
ifneq ($(shell uname), Darwin)
|
||||||
|
EXTLDFLAGS = -extldflags "-static" $(null)
|
||||||
|
else
|
||||||
|
EXTLDFLAGS =
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ACT ?= go run main.go
|
ifeq ($(HAS_GO), GO)
|
||||||
|
GOPATH ?= $(shell $(GO) env GOPATH)
|
||||||
|
export PATH := $(GOPATH)/bin:$(PATH)
|
||||||
|
|
||||||
HAS_TOKEN = $(if $(test -e ~/.config/github/token),true,false)
|
CGO_EXTRA_CFLAGS := -DSQLITE_MAX_VARIABLE_NUMBER=32766
|
||||||
ifeq (true,$(HAS_TOKEN))
|
CGO_CFLAGS ?= $(shell $(GO) env CGO_CFLAGS) $(CGO_EXTRA_CFLAGS)
|
||||||
export GITHUB_TOKEN := $(shell cat ~/.config/github/token)
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
.PHONY: pr
|
ifeq ($(OS), Windows_NT)
|
||||||
pr: tidy format-all lint test
|
GOFLAGS := -v -buildmode=exe
|
||||||
|
EXECUTABLE ?= $(EXECUTABLE).exe
|
||||||
.PHONY: build
|
else ifeq ($(OS), Windows)
|
||||||
build:
|
GOFLAGS := -v -buildmode=exe
|
||||||
go build -ldflags "-X main.version=$(VERSION)" -o dist/local/act main.go
|
EXECUTABLE ?= $(EXECUTABLE).exe
|
||||||
|
else
|
||||||
.PHONY: format
|
GOFLAGS := -v
|
||||||
format:
|
EXECUTABLE ?= $(EXECUTABLE)
|
||||||
go fmt ./...
|
|
||||||
|
|
||||||
.PHONY: format-all
|
|
||||||
format-all:
|
|
||||||
go fmt ./...
|
|
||||||
npx prettier --write .
|
|
||||||
|
|
||||||
.PHONY: test
|
|
||||||
test:
|
|
||||||
go test ./...
|
|
||||||
$(ACT)
|
|
||||||
|
|
||||||
.PHONY: lint-go
|
|
||||||
lint-go:
|
|
||||||
golangci-lint run $(FIX)
|
|
||||||
|
|
||||||
.PHONY: lint-js
|
|
||||||
lint-js:
|
|
||||||
npx standard $(FIX)
|
|
||||||
|
|
||||||
.PHONY: lint-md
|
|
||||||
lint-md:
|
|
||||||
npx markdownlint . $(FIX)
|
|
||||||
|
|
||||||
.PHONY: lint-rest
|
|
||||||
lint-rest:
|
|
||||||
docker run --rm -it \
|
|
||||||
-v $(PWD):/tmp/lint \
|
|
||||||
-e GITHUB_STATUS_REPORTER=false \
|
|
||||||
-e GITHUB_COMMENT_REPORTER=false \
|
|
||||||
megalinter/megalinter-go:v5
|
|
||||||
|
|
||||||
.PHONY: lint
|
|
||||||
lint: lint-go lint-rest
|
|
||||||
|
|
||||||
.PHONY: lint-fix
|
|
||||||
lint-fix: lint-md lint-go
|
|
||||||
|
|
||||||
.PHONY: fix
|
|
||||||
fix:
|
|
||||||
make lint-fix fix=true
|
|
||||||
|
|
||||||
.PHONY: tidy
|
|
||||||
tidy:
|
|
||||||
go mod tidy
|
|
||||||
|
|
||||||
.PHONY: install
|
|
||||||
install: build
|
|
||||||
@cp dist/local/act $(PREFIX)/bin/act
|
|
||||||
@chmod 755 $(PREFIX)/bin/act
|
|
||||||
@act --version
|
|
||||||
|
|
||||||
.PHONY: installer
|
|
||||||
installer:
|
|
||||||
@GO111MODULE=off go get github.com/goreleaser/godownloader
|
|
||||||
godownloader -r nektos/act -o install.sh
|
|
||||||
|
|
||||||
.PHONY: promote
|
|
||||||
promote:
|
|
||||||
@git fetch --tags
|
|
||||||
@echo "VERSION:$(VERSION) IS_SNAPSHOT:$(IS_SNAPSHOT) NEW_VERSION:$(NEW_VERSION)"
|
|
||||||
ifeq (false,$(IS_SNAPSHOT))
|
|
||||||
@echo "Unable to promote a non-snapshot"
|
|
||||||
@exit 1
|
|
||||||
endif
|
endif
|
||||||
ifneq ($(shell git status -s),)
|
|
||||||
@echo "Unable to promote a dirty workspace"
|
STORED_VERSION_FILE := VERSION
|
||||||
@exit 1
|
|
||||||
|
ifneq ($(DRONE_TAG),)
|
||||||
|
VERSION ?= $(subst v,,$(DRONE_TAG))
|
||||||
|
RELASE_VERSION ?= $(VERSION)
|
||||||
|
else
|
||||||
|
ifneq ($(DRONE_BRANCH),)
|
||||||
|
VERSION ?= $(subst release/v,,$(DRONE_BRANCH))
|
||||||
|
else
|
||||||
|
VERSION ?= main
|
||||||
|
endif
|
||||||
|
|
||||||
|
STORED_VERSION=$(shell cat $(STORED_VERSION_FILE) 2>/dev/null)
|
||||||
|
ifneq ($(STORED_VERSION),)
|
||||||
|
RELASE_VERSION ?= $(STORED_VERSION)
|
||||||
|
else
|
||||||
|
RELASE_VERSION ?= $(shell git describe --tags --always | sed 's/-/+/' | sed 's/^v//')
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
echo -n $(NEW_VERSION) > VERSION
|
|
||||||
git add VERSION
|
|
||||||
git commit -m "chore: bump VERSION to $(NEW_VERSION)"
|
|
||||||
git tag -a -m "releasing v$(NEW_VERSION)" v$(NEW_VERSION)
|
|
||||||
git push origin master
|
|
||||||
git push origin v$(NEW_VERSION)
|
|
||||||
|
|
||||||
.PHONY: snapshot
|
GO_PACKAGES_TO_VET ?= $(filter-out gitea.com/gitea/act_runner/internal/pkg/client/mocks,$(shell $(GO) list ./...))
|
||||||
snapshot:
|
|
||||||
goreleaser build \
|
|
||||||
--clean \
|
|
||||||
--single-target \
|
|
||||||
--snapshot
|
|
||||||
|
|
||||||
.PHONY: clean all
|
|
||||||
|
TAGS ?=
|
||||||
|
LDFLAGS ?= -X "gitea.com/gitea/act_runner/internal/pkg/ver.version=$(RELASE_VERSION)"
|
||||||
|
|
||||||
|
all: build
|
||||||
|
|
||||||
|
fmt:
|
||||||
|
@hash gofumpt > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
|
||||||
|
$(GO) install mvdan.cc/gofumpt@latest; \
|
||||||
|
fi
|
||||||
|
$(GOFMT) -w $(GO_FMT_FILES)
|
||||||
|
|
||||||
|
.PHONY: go-check
|
||||||
|
go-check:
|
||||||
|
$(eval MIN_GO_VERSION_STR := $(shell grep -Eo '^go\s+[0-9]+\.[0-9]+' go.mod | cut -d' ' -f2))
|
||||||
|
$(eval MIN_GO_VERSION := $(shell printf "%03d%03d" $(shell echo '$(MIN_GO_VERSION_STR)' | tr '.' ' ')))
|
||||||
|
$(eval GO_VERSION := $(shell printf "%03d%03d" $(shell $(GO) version | grep -Eo '[0-9]+\.[0-9]+' | tr '.' ' ');))
|
||||||
|
@if [ "$(GO_VERSION)" -lt "$(MIN_GO_VERSION)" ]; then \
|
||||||
|
echo "Act Runner requires Go $(MIN_GO_VERSION_STR) or greater to build. You can get it at https://go.dev/dl/"; \
|
||||||
|
exit 1; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
.PHONY: fmt-check
|
||||||
|
fmt-check:
|
||||||
|
@hash gofumpt > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
|
||||||
|
$(GO) install mvdan.cc/gofumpt@latest; \
|
||||||
|
fi
|
||||||
|
@diff=$$($(GOFMT) -d $(GO_FMT_FILES)); \
|
||||||
|
if [ -n "$$diff" ]; then \
|
||||||
|
echo "Please run 'make fmt' and commit the result:"; \
|
||||||
|
echo "$${diff}"; \
|
||||||
|
exit 1; \
|
||||||
|
fi;
|
||||||
|
|
||||||
|
test: fmt-check
|
||||||
|
@$(GO) test -v -cover -coverprofile coverage.txt ./... && echo "\n==>\033[32m Ok\033[m\n" || exit 1
|
||||||
|
|
||||||
|
.PHONY: vet
|
||||||
|
vet:
|
||||||
|
@echo "Running go vet..."
|
||||||
|
@$(GO) build code.gitea.io/gitea-vet
|
||||||
|
@$(GO) vet -vettool=gitea-vet $(GO_PACKAGES_TO_VET)
|
||||||
|
|
||||||
|
install: $(GOFILES)
|
||||||
|
$(GO) install -v -tags '$(TAGS)' -ldflags '$(EXTLDFLAGS)-s -w $(LDFLAGS)'
|
||||||
|
|
||||||
|
build: go-check $(EXECUTABLE)
|
||||||
|
|
||||||
|
$(EXECUTABLE): $(GOFILES)
|
||||||
|
$(GO) build -v -tags '$(TAGS)' -ldflags '$(EXTLDFLAGS)-s -w $(LDFLAGS)' -o $@
|
||||||
|
|
||||||
|
.PHONY: deps-backend
|
||||||
|
deps-backend:
|
||||||
|
$(GO) mod download
|
||||||
|
$(GO) install $(GXZ_PAGAGE)
|
||||||
|
$(GO) install $(XGO_PACKAGE)
|
||||||
|
|
||||||
|
.PHONY: release
|
||||||
|
release: release-windows release-linux release-darwin release-copy release-compress release-check
|
||||||
|
|
||||||
|
$(DIST_DIRS):
|
||||||
|
mkdir -p $(DIST_DIRS)
|
||||||
|
|
||||||
|
.PHONY: release-windows
|
||||||
|
release-windows: | $(DIST_DIRS)
|
||||||
|
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) run $(XGO_PACKAGE) -go $(XGO_VERSION) -buildmode exe -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets '$(WINDOWS_ARCHS)' -out $(EXECUTABLE)-$(VERSION) .
|
||||||
|
ifeq ($(CI),true)
|
||||||
|
cp -r /build/* $(DIST)/binaries/
|
||||||
|
endif
|
||||||
|
|
||||||
|
.PHONY: release-linux
|
||||||
|
release-linux: | $(DIST_DIRS)
|
||||||
|
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) run $(XGO_PACKAGE) -go $(XGO_VERSION) -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets '$(LINUX_ARCHS)' -out $(EXECUTABLE)-$(VERSION) .
|
||||||
|
ifeq ($(CI),true)
|
||||||
|
cp -r /build/* $(DIST)/binaries/
|
||||||
|
endif
|
||||||
|
|
||||||
|
.PHONY: release-darwin
|
||||||
|
release-darwin: | $(DIST_DIRS)
|
||||||
|
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) run $(XGO_PACKAGE) -go $(XGO_VERSION) -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '$(LDFLAGS)' -targets '$(DARWIN_ARCHS)' -out $(EXECUTABLE)-$(VERSION) .
|
||||||
|
ifeq ($(CI),true)
|
||||||
|
cp -r /build/* $(DIST)/binaries/
|
||||||
|
endif
|
||||||
|
|
||||||
|
.PHONY: release-copy
|
||||||
|
release-copy: | $(DIST_DIRS)
|
||||||
|
cd $(DIST); for file in `find . -type f -name "*"`; do cp $${file} ./release/; done;
|
||||||
|
|
||||||
|
.PHONY: release-check
|
||||||
|
release-check: | $(DIST_DIRS)
|
||||||
|
cd $(DIST)/release/; for file in `find . -type f -name "*"`; do echo "checksumming $${file}" && $(SHASUM) `echo $${file} | sed 's/^..//'` > $${file}.sha256; done;
|
||||||
|
|
||||||
|
.PHONY: release-compress
|
||||||
|
release-compress: | $(DIST_DIRS)
|
||||||
|
cd $(DIST)/release/; for file in `find . -type f -name "*"`; do echo "compressing $${file}" && $(GO) run $(GXZ_PAGAGE) -k -9 $${file}; done;
|
||||||
|
|
||||||
|
.PHONY: docker
|
||||||
|
docker:
|
||||||
|
if ! docker buildx version >/dev/null 2>&1; then \
|
||||||
|
ARG_DISABLE_CONTENT_TRUST=--disable-content-trust=false; \
|
||||||
|
fi; \
|
||||||
|
docker build $${ARG_DISABLE_CONTENT_TRUST} -t $(DOCKER_REF) .
|
||||||
|
|
||||||
|
clean:
|
||||||
|
$(GO) clean -x -i ./...
|
||||||
|
rm -rf coverage.txt $(EXECUTABLE) $(DIST)
|
||||||
|
|
||||||
|
version:
|
||||||
|
@echo $(VERSION)
|
||||||
@@ -1,62 +1,119 @@
|
|||||||
## Forking rules
|
# act runner
|
||||||
|
|
||||||
This is a custom fork of [nektos/act](https://github.com/nektos/act/), for the purpose of serving [act_runner](https://gitea.com/gitea/act_runner).
|
Act runner is a runner for Gitea based on [Gitea fork](https://gitea.com/gitea/act) of [act](https://github.com/nektos/act).
|
||||||
|
|
||||||
It cannot be used as command line tool anymore, but only as a library.
|
## Installation
|
||||||
|
|
||||||
It's a soft fork, which means that it will track the latest release of nektos/act.
|
### Prerequisites
|
||||||
|
|
||||||
Branches:
|
Docker Engine Community version is required for docker mode. To install Docker CE, follow the official [install instructions](https://docs.docker.com/engine/install/).
|
||||||
|
|
||||||
- `main`: default branch, contains custom changes, based on the latest release(not the latest of the master branch) of nektos/act.
|
### Download pre-built binary
|
||||||
- `nektos/master`: mirror for the master branch of nektos/act.
|
|
||||||
|
|
||||||
Tags:
|
Visit [here](https://dl.gitea.com/act_runner/) and download the right version for your platform.
|
||||||
|
|
||||||
- `nektos/vX.Y.Z`: mirror for `vX.Y.Z` of [nektos/act](https://github.com/nektos/act/).
|
### Build from source
|
||||||
- `vX.YZ.*`: based on `nektos/vX.Y.Z`, contains custom changes.
|
|
||||||
- Examples:
|
|
||||||
- `nektos/v0.2.23` -> `v0.223.*`
|
|
||||||
- `nektos/v0.3.1` -> `v0.301.*`, not ~~`v0.31.*`~~
|
|
||||||
- `nektos/v0.10.1` -> `v0.1001.*`, not ~~`v0.101.*`~~
|
|
||||||
- `nektos/v0.3.100` -> not ~~`v0.3100.*`~~, I don't think it's really going to happen, if it does, we can find a way to handle it.
|
|
||||||
|
|
||||||
---
|
```bash
|
||||||
|
make build
|
||||||
|
```
|
||||||
|
|
||||||

|
### Build a docker image
|
||||||
|
|
||||||
# Overview [](https://github.com/nektos/act/actions) [](https://gitter.im/nektos/act?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [](https://goreportcard.com/report/github.com/nektos/act) [](https://github.com/jonico/awesome-runners)
|
```bash
|
||||||
|
make docker
|
||||||
|
```
|
||||||
|
|
||||||
> "Think globally, `act` locally"
|
## Quickstart
|
||||||
|
|
||||||
Run your [GitHub Actions](https://developer.github.com/actions/) locally! Why would you want to do this? Two reasons:
|
### Register
|
||||||
|
|
||||||
- **Fast Feedback** - Rather than having to commit/push every time you want to test out the changes you are making to your `.github/workflows/` files (or for any changes to embedded GitHub actions), you can use `act` to run the actions locally. The [environment variables](https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables#default-environment-variables) and [filesystem](https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners#filesystems-on-github-hosted-runners) are all configured to match what GitHub provides.
|
```bash
|
||||||
- **Local Task Runner** - I love [make](<https://en.wikipedia.org/wiki/Make_(software)>). However, I also hate repeating myself. With `act`, you can use the GitHub Actions defined in your `.github/workflows/` to replace your `Makefile`!
|
./act_runner register
|
||||||
|
```
|
||||||
|
|
||||||
# How Does It Work?
|
And you will be asked to input:
|
||||||
|
|
||||||
When you run `act` it reads in your GitHub Actions from `.github/workflows/` and determines the set of actions that need to be run. It uses the Docker API to either pull or build the necessary images, as defined in your workflow files and finally determines the execution path based on the dependencies that were defined. Once it has the execution path, it then uses the Docker API to run containers for each action based on the images prepared earlier. The [environment variables](https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables#default-environment-variables) and [filesystem](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#file-systems) are all configured to match what GitHub provides.
|
1. Gitea instance URL, like `http://192.168.8.8:3000/`. You should use your gitea instance ROOT_URL as the instance argument
|
||||||
|
and you should not use `localhost` or `127.0.0.1` as instance IP;
|
||||||
|
2. Runner token, you can get it from `http://192.168.8.8:3000/admin/runners`;
|
||||||
|
3. Runner name, you can just leave it blank;
|
||||||
|
4. Runner labels, you can just leave it blank.
|
||||||
|
|
||||||
Let's see it in action with a [sample repo](https://github.com/cplee/github-actions-demo)!
|
The process looks like:
|
||||||
|
|
||||||

|
```text
|
||||||
|
INFO Registering runner, arch=amd64, os=darwin, version=0.1.5.
|
||||||
|
WARN Runner in user-mode.
|
||||||
|
INFO Enter the Gitea instance URL (for example, https://gitea.com/):
|
||||||
|
http://192.168.8.8:3000/
|
||||||
|
INFO Enter the runner token:
|
||||||
|
fe884e8027dc292970d4e0303fe82b14xxxxxxxx
|
||||||
|
INFO Enter the runner name (if set empty, use hostname: Test.local):
|
||||||
|
|
||||||
# Act User Guide
|
INFO Enter the runner labels, leave blank to use the default labels (comma-separated, for example, ubuntu-20.04:docker://node:16-bullseye,ubuntu-18.04:docker://node:16-buster,linux_arm:host):
|
||||||
|
|
||||||
Please look at the [act user guide](https://nektosact.com) for more documentation.
|
INFO Registering runner, name=Test.local, instance=http://192.168.8.8:3000/, labels=[ubuntu-latest:docker://node:16-bullseye ubuntu-22.04:docker://node:16-bullseye ubuntu-20.04:docker://node:16-bullseye ubuntu-18.04:docker://node:16-buster].
|
||||||
|
DEBU Successfully pinged the Gitea instance server
|
||||||
|
INFO Runner registered successfully.
|
||||||
|
```
|
||||||
|
|
||||||
# Support
|
You can also register with command line arguments.
|
||||||
|
|
||||||
Need help? Ask on [Gitter](https://gitter.im/nektos/act)!
|
```bash
|
||||||
|
./act_runner register --instance http://192.168.8.8:3000 --token <my_runner_token> --no-interactive
|
||||||
|
```
|
||||||
|
|
||||||
# Contributing
|
If the registry succeed, it will run immediately. Next time, you could run the runner directly.
|
||||||
|
|
||||||
Want to contribute to act? Awesome! Check out the [contributing guidelines](CONTRIBUTING.md) to get involved.
|
### Run
|
||||||
|
|
||||||
## Manually building from source
|
```bash
|
||||||
|
./act_runner daemon
|
||||||
|
```
|
||||||
|
|
||||||
- Install Go tools 1.20+ - (<https://golang.org/doc/install>)
|
### Configuration
|
||||||
- Clone this repo `git clone [email protected]:nektos/act.git`
|
|
||||||
- Run unit tests with `make test`
|
You can also configure the runner with a configuration file.
|
||||||
- Build and install: `make install`
|
The configuration file is a YAML file, you can generate a sample configuration file with `./act_runner generate-config`.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./act_runner generate-config > config.yaml
|
||||||
|
```
|
||||||
|
|
||||||
|
You can specify the configuration file path with `-c`/`--config` argument.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./act_runner -c config.yaml register # register with config file
|
||||||
|
./act_runner -c config.yaml deamon # run with config file
|
||||||
|
```
|
||||||
|
|
||||||
|
### Run a docker container
|
||||||
|
|
||||||
|
```sh
|
||||||
|
docker run -e GITEA_INSTANCE_URL=http://192.168.8.18:3000 -e GITEA_RUNNER_REGISTRATION_TOKEN=<runner_token> -v /var/run/docker.sock:/var/run/docker.sock -v $PWD/data:/data --name my_runner gitea/act_runner:nightly
|
||||||
|
```
|
||||||
|
|
||||||
|
The `/data` directory inside the docker container contains the runner API keys after registration.
|
||||||
|
It must be persisted, otherwise the runner would try to register again, using the same, now defunct registration token.
|
||||||
|
|
||||||
|
### Running in docker-compose
|
||||||
|
|
||||||
|
```yml
|
||||||
|
...
|
||||||
|
gitea:
|
||||||
|
image: gitea/gitea
|
||||||
|
...
|
||||||
|
|
||||||
|
runner:
|
||||||
|
image: gitea/act_runner
|
||||||
|
restart: always
|
||||||
|
depends_on:
|
||||||
|
- gitea
|
||||||
|
volumes:
|
||||||
|
- ./data/act_runner:/data
|
||||||
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
|
environment:
|
||||||
|
- GITEA_INSTANCE_URL=<instance url>
|
||||||
|
- GITEA_RUNNER_REGISTRATION_TOKEN=<registration token>
|
||||||
|
```
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
VERIFICATION
|
|
||||||
Verification is intended to assist the Chocolatey moderators and community
|
|
||||||
in verifying that this package's contents are trustworthy.
|
|
||||||
|
|
||||||
Checksums: https://github.com/nektos/act/releases, in the checksums.txt file
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!-- Do not remove this test for UTF-8: if “Ω” doesn’t appear as greek uppercase omega letter enclosed in quotation marks, you should use an editor that supports UTF-8, not this one. -->
|
|
||||||
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
|
|
||||||
<metadata>
|
|
||||||
<id>act-cli</id>
|
|
||||||
<version>0.0.0</version>
|
|
||||||
<packageSourceUrl>https://github.com/nektos/act</packageSourceUrl>
|
|
||||||
<owners>nektos</owners>
|
|
||||||
<title>act (GitHub Actions CLI)</title>
|
|
||||||
<authors>nektos</authors>
|
|
||||||
<projectUrl>https://github.com/nektos/act</projectUrl>
|
|
||||||
<iconUrl>https://raw.githubusercontent.com/wiki/nektos/act/img/logo-150.png</iconUrl>
|
|
||||||
<copyright>Nektos</copyright>
|
|
||||||
<licenseUrl>https://raw.githubusercontent.com/nektos/act/master/LICENSE</licenseUrl>
|
|
||||||
<requireLicenseAcceptance>true</requireLicenseAcceptance>
|
|
||||||
<projectSourceUrl>https://github.com/nektos/act</projectSourceUrl>
|
|
||||||
<docsUrl>https://raw.githubusercontent.com/nektos/act/master/README.md</docsUrl>
|
|
||||||
<bugTrackerUrl>https://github.com/nektos/act/issues</bugTrackerUrl>
|
|
||||||
<tags>act github-actions actions golang ci devops</tags>
|
|
||||||
<summary>Run your GitHub Actions locally 🚀</summary>
|
|
||||||
<description>Run your GitHub Actions locally 🚀</description>
|
|
||||||
</metadata>
|
|
||||||
<files>
|
|
||||||
<file src="tools/**" target="tools" />
|
|
||||||
</files>
|
|
||||||
</package>
|
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
// Copyright 2023 The Gitea Authors. All rights reserved.
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
//go:build vendor
|
||||||
|
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
// for vet
|
||||||
|
_ "code.gitea.io/gitea-vet"
|
||||||
|
)
|
||||||
-27
@@ -1,27 +0,0 @@
|
|||||||
package cmd
|
|
||||||
|
|
||||||
import (
|
|
||||||
"os"
|
|
||||||
"path/filepath"
|
|
||||||
|
|
||||||
log "github.com/sirupsen/logrus"
|
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
|
||||||
UserHomeDir string
|
|
||||||
CacheHomeDir string
|
|
||||||
)
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
home, err := os.UserHomeDir()
|
|
||||||
if err != nil {
|
|
||||||
log.Fatal(err)
|
|
||||||
}
|
|
||||||
UserHomeDir = home
|
|
||||||
|
|
||||||
if v := os.Getenv("XDG_CACHE_HOME"); v != "" {
|
|
||||||
CacheHomeDir = v
|
|
||||||
} else {
|
|
||||||
CacheHomeDir = filepath.Join(UserHomeDir, ".cache")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
package cmd
|
|
||||||
|
|
||||||
import (
|
|
||||||
"os"
|
|
||||||
|
|
||||||
"github.com/nektos/act/pkg/common"
|
|
||||||
"github.com/nektos/act/pkg/model"
|
|
||||||
)
|
|
||||||
|
|
||||||
func drawGraph(plan *model.Plan) error {
|
|
||||||
drawings := make([]*common.Drawing, 0)
|
|
||||||
|
|
||||||
jobPen := common.NewPen(common.StyleSingleLine, 96)
|
|
||||||
arrowPen := common.NewPen(common.StyleNoLine, 97)
|
|
||||||
for i, stage := range plan.Stages {
|
|
||||||
if i > 0 {
|
|
||||||
drawings = append(drawings, arrowPen.DrawArrow())
|
|
||||||
}
|
|
||||||
|
|
||||||
ids := make([]string, 0)
|
|
||||||
for _, r := range stage.Runs {
|
|
||||||
ids = append(ids, r.String())
|
|
||||||
}
|
|
||||||
drawings = append(drawings, jobPen.DrawBoxes(ids...))
|
|
||||||
}
|
|
||||||
|
|
||||||
maxWidth := 0
|
|
||||||
for _, d := range drawings {
|
|
||||||
if d.GetWidth() > maxWidth {
|
|
||||||
maxWidth = d.GetWidth()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, d := range drawings {
|
|
||||||
d.Draw(os.Stdout, maxWidth)
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
-112
@@ -1,112 +0,0 @@
|
|||||||
package cmd
|
|
||||||
|
|
||||||
import (
|
|
||||||
"path/filepath"
|
|
||||||
|
|
||||||
log "github.com/sirupsen/logrus"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Input contains the input for the root command
|
|
||||||
type Input struct {
|
|
||||||
actor string
|
|
||||||
workdir string
|
|
||||||
workflowsPath string
|
|
||||||
autodetectEvent bool
|
|
||||||
eventPath string
|
|
||||||
reuseContainers bool
|
|
||||||
bindWorkdir bool
|
|
||||||
secrets []string
|
|
||||||
vars []string
|
|
||||||
envs []string
|
|
||||||
inputs []string
|
|
||||||
platforms []string
|
|
||||||
dryrun bool
|
|
||||||
forcePull bool
|
|
||||||
forceRebuild bool
|
|
||||||
noOutput bool
|
|
||||||
envfile string
|
|
||||||
inputfile string
|
|
||||||
secretfile string
|
|
||||||
varfile string
|
|
||||||
insecureSecrets bool
|
|
||||||
defaultBranch string
|
|
||||||
privileged bool
|
|
||||||
usernsMode string
|
|
||||||
containerArchitecture string
|
|
||||||
containerDaemonSocket string
|
|
||||||
containerOptions string
|
|
||||||
noWorkflowRecurse bool
|
|
||||||
useGitIgnore bool
|
|
||||||
githubInstance string
|
|
||||||
containerCapAdd []string
|
|
||||||
containerCapDrop []string
|
|
||||||
autoRemove bool
|
|
||||||
artifactServerPath string
|
|
||||||
artifactServerAddr string
|
|
||||||
artifactServerPort string
|
|
||||||
noCacheServer bool
|
|
||||||
cacheServerPath string
|
|
||||||
cacheServerAddr string
|
|
||||||
cacheServerPort uint16
|
|
||||||
jsonLogger bool
|
|
||||||
noSkipCheckout bool
|
|
||||||
remoteName string
|
|
||||||
replaceGheActionWithGithubCom []string
|
|
||||||
replaceGheActionTokenWithGithubCom string
|
|
||||||
matrix []string
|
|
||||||
actionCachePath string
|
|
||||||
actionOfflineMode bool
|
|
||||||
logPrefixJobID bool
|
|
||||||
networkName string
|
|
||||||
useNewActionCache bool
|
|
||||||
localRepository []string
|
|
||||||
maxParallel int
|
|
||||||
}
|
|
||||||
|
|
||||||
func (i *Input) resolve(path string) string {
|
|
||||||
basedir, err := filepath.Abs(i.workdir)
|
|
||||||
if err != nil {
|
|
||||||
log.Fatal(err)
|
|
||||||
}
|
|
||||||
if path == "" {
|
|
||||||
return path
|
|
||||||
}
|
|
||||||
if !filepath.IsAbs(path) {
|
|
||||||
path = filepath.Join(basedir, path)
|
|
||||||
}
|
|
||||||
return path
|
|
||||||
}
|
|
||||||
|
|
||||||
// Envfile returns path to .env
|
|
||||||
func (i *Input) Envfile() string {
|
|
||||||
return i.resolve(i.envfile)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Secretfile returns path to secrets
|
|
||||||
func (i *Input) Secretfile() string {
|
|
||||||
return i.resolve(i.secretfile)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (i *Input) Varfile() string {
|
|
||||||
return i.resolve(i.varfile)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Workdir returns path to workdir
|
|
||||||
func (i *Input) Workdir() string {
|
|
||||||
return i.resolve(".")
|
|
||||||
}
|
|
||||||
|
|
||||||
// WorkflowsPath returns path to workflow file(s)
|
|
||||||
func (i *Input) WorkflowsPath() string {
|
|
||||||
return i.resolve(i.workflowsPath)
|
|
||||||
}
|
|
||||||
|
|
||||||
// EventPath returns the path to events file
|
|
||||||
func (i *Input) EventPath() string {
|
|
||||||
return i.resolve(i.eventPath)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Inputfile returns the path to the input file
|
|
||||||
func (i *Input) Inputfile() string {
|
|
||||||
return i.resolve(i.inputfile)
|
|
||||||
}
|
|
||||||
-107
@@ -1,107 +0,0 @@
|
|||||||
package cmd
|
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
"strconv"
|
|
||||||
"strings"
|
|
||||||
|
|
||||||
"github.com/nektos/act/pkg/model"
|
|
||||||
)
|
|
||||||
|
|
||||||
func printList(plan *model.Plan) error {
|
|
||||||
type lineInfoDef struct {
|
|
||||||
jobID string
|
|
||||||
jobName string
|
|
||||||
stage string
|
|
||||||
wfName string
|
|
||||||
wfFile string
|
|
||||||
events string
|
|
||||||
}
|
|
||||||
lineInfos := []lineInfoDef{}
|
|
||||||
|
|
||||||
header := lineInfoDef{
|
|
||||||
jobID: "Job ID",
|
|
||||||
jobName: "Job name",
|
|
||||||
stage: "Stage",
|
|
||||||
wfName: "Workflow name",
|
|
||||||
wfFile: "Workflow file",
|
|
||||||
events: "Events",
|
|
||||||
}
|
|
||||||
|
|
||||||
jobs := map[string]bool{}
|
|
||||||
duplicateJobIDs := false
|
|
||||||
|
|
||||||
jobIDMaxWidth := len(header.jobID)
|
|
||||||
jobNameMaxWidth := len(header.jobName)
|
|
||||||
stageMaxWidth := len(header.stage)
|
|
||||||
wfNameMaxWidth := len(header.wfName)
|
|
||||||
wfFileMaxWidth := len(header.wfFile)
|
|
||||||
eventsMaxWidth := len(header.events)
|
|
||||||
|
|
||||||
for i, stage := range plan.Stages {
|
|
||||||
for _, r := range stage.Runs {
|
|
||||||
jobID := r.JobID
|
|
||||||
line := lineInfoDef{
|
|
||||||
jobID: jobID,
|
|
||||||
jobName: r.String(),
|
|
||||||
stage: strconv.Itoa(i),
|
|
||||||
wfName: r.Workflow.Name,
|
|
||||||
wfFile: r.Workflow.File,
|
|
||||||
events: strings.Join(r.Workflow.On(), `,`),
|
|
||||||
}
|
|
||||||
if _, ok := jobs[jobID]; ok {
|
|
||||||
duplicateJobIDs = true
|
|
||||||
} else {
|
|
||||||
jobs[jobID] = true
|
|
||||||
}
|
|
||||||
lineInfos = append(lineInfos, line)
|
|
||||||
if jobIDMaxWidth < len(line.jobID) {
|
|
||||||
jobIDMaxWidth = len(line.jobID)
|
|
||||||
}
|
|
||||||
if jobNameMaxWidth < len(line.jobName) {
|
|
||||||
jobNameMaxWidth = len(line.jobName)
|
|
||||||
}
|
|
||||||
if stageMaxWidth < len(line.stage) {
|
|
||||||
stageMaxWidth = len(line.stage)
|
|
||||||
}
|
|
||||||
if wfNameMaxWidth < len(line.wfName) {
|
|
||||||
wfNameMaxWidth = len(line.wfName)
|
|
||||||
}
|
|
||||||
if wfFileMaxWidth < len(line.wfFile) {
|
|
||||||
wfFileMaxWidth = len(line.wfFile)
|
|
||||||
}
|
|
||||||
if eventsMaxWidth < len(line.events) {
|
|
||||||
eventsMaxWidth = len(line.events)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
jobIDMaxWidth += 2
|
|
||||||
jobNameMaxWidth += 2
|
|
||||||
stageMaxWidth += 2
|
|
||||||
wfNameMaxWidth += 2
|
|
||||||
wfFileMaxWidth += 2
|
|
||||||
|
|
||||||
fmt.Printf("%*s%*s%*s%*s%*s%*s\n",
|
|
||||||
-stageMaxWidth, header.stage,
|
|
||||||
-jobIDMaxWidth, header.jobID,
|
|
||||||
-jobNameMaxWidth, header.jobName,
|
|
||||||
-wfNameMaxWidth, header.wfName,
|
|
||||||
-wfFileMaxWidth, header.wfFile,
|
|
||||||
-eventsMaxWidth, header.events,
|
|
||||||
)
|
|
||||||
for _, line := range lineInfos {
|
|
||||||
fmt.Printf("%*s%*s%*s%*s%*s%*s\n",
|
|
||||||
-stageMaxWidth, line.stage,
|
|
||||||
-jobIDMaxWidth, line.jobID,
|
|
||||||
-jobNameMaxWidth, line.jobName,
|
|
||||||
-wfNameMaxWidth, line.wfName,
|
|
||||||
-wfFileMaxWidth, line.wfFile,
|
|
||||||
-eventsMaxWidth, line.events,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
if duplicateJobIDs {
|
|
||||||
fmt.Print("\nDetected multiple jobs with the same job name, use `-W` to specify the path to the specific workflow.\n")
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
-140
@@ -1,140 +0,0 @@
|
|||||||
package cmd
|
|
||||||
|
|
||||||
import (
|
|
||||||
"encoding/json"
|
|
||||||
"fmt"
|
|
||||||
"net/http"
|
|
||||||
"net/url"
|
|
||||||
"os"
|
|
||||||
"path/filepath"
|
|
||||||
"runtime"
|
|
||||||
"strings"
|
|
||||||
"time"
|
|
||||||
|
|
||||||
log "github.com/sirupsen/logrus"
|
|
||||||
)
|
|
||||||
|
|
||||||
type Notice struct {
|
|
||||||
Level string `json:"level"`
|
|
||||||
Message string `json:"message"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func displayNotices(input *Input) {
|
|
||||||
select {
|
|
||||||
case notices := <-noticesLoaded:
|
|
||||||
if len(notices) > 0 {
|
|
||||||
noticeLogger := log.New()
|
|
||||||
if input.jsonLogger {
|
|
||||||
noticeLogger.SetFormatter(&log.JSONFormatter{})
|
|
||||||
} else {
|
|
||||||
noticeLogger.SetFormatter(&log.TextFormatter{
|
|
||||||
DisableQuote: true,
|
|
||||||
DisableTimestamp: true,
|
|
||||||
PadLevelText: true,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
fmt.Printf("\n")
|
|
||||||
for _, notice := range notices {
|
|
||||||
level, err := log.ParseLevel(notice.Level)
|
|
||||||
if err != nil {
|
|
||||||
level = log.InfoLevel
|
|
||||||
}
|
|
||||||
noticeLogger.Log(level, notice.Message)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
case <-time.After(time.Second * 1):
|
|
||||||
log.Debugf("Timeout waiting for notices")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var noticesLoaded = make(chan []Notice)
|
|
||||||
|
|
||||||
func loadVersionNotices(version string) {
|
|
||||||
go func() {
|
|
||||||
noticesLoaded <- getVersionNotices(version)
|
|
||||||
}()
|
|
||||||
}
|
|
||||||
|
|
||||||
const NoticeURL = "https://api.nektosact.com/notices"
|
|
||||||
|
|
||||||
func getVersionNotices(version string) []Notice {
|
|
||||||
if os.Getenv("ACT_DISABLE_VERSION_CHECK") == "1" {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
noticeURL, err := url.Parse(NoticeURL)
|
|
||||||
if err != nil {
|
|
||||||
log.Error(err)
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
query := noticeURL.Query()
|
|
||||||
query.Add("os", runtime.GOOS)
|
|
||||||
query.Add("arch", runtime.GOARCH)
|
|
||||||
query.Add("version", version)
|
|
||||||
|
|
||||||
noticeURL.RawQuery = query.Encode()
|
|
||||||
|
|
||||||
client := &http.Client{}
|
|
||||||
req, err := http.NewRequest("GET", noticeURL.String(), nil)
|
|
||||||
if err != nil {
|
|
||||||
log.Debug(err)
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
etag := loadNoticesEtag()
|
|
||||||
if etag != "" {
|
|
||||||
log.Debugf("Conditional GET for notices etag=%s", etag)
|
|
||||||
req.Header.Set("If-None-Match", etag)
|
|
||||||
}
|
|
||||||
|
|
||||||
resp, err := client.Do(req)
|
|
||||||
if err != nil {
|
|
||||||
log.Debug(err)
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
newEtag := resp.Header.Get("Etag")
|
|
||||||
if newEtag != "" {
|
|
||||||
log.Debugf("Saving notices etag=%s", newEtag)
|
|
||||||
saveNoticesEtag(newEtag)
|
|
||||||
}
|
|
||||||
|
|
||||||
defer resp.Body.Close()
|
|
||||||
notices := []Notice{}
|
|
||||||
if resp.StatusCode == 304 {
|
|
||||||
log.Debug("No new notices")
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
if err := json.NewDecoder(resp.Body).Decode(¬ices); err != nil {
|
|
||||||
log.Debug(err)
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
return notices
|
|
||||||
}
|
|
||||||
|
|
||||||
func loadNoticesEtag() string {
|
|
||||||
p := etagPath()
|
|
||||||
content, err := os.ReadFile(p)
|
|
||||||
if err != nil {
|
|
||||||
log.Debugf("Unable to load etag from %s: %e", p, err)
|
|
||||||
}
|
|
||||||
return strings.TrimSuffix(string(content), "\n")
|
|
||||||
}
|
|
||||||
|
|
||||||
func saveNoticesEtag(etag string) {
|
|
||||||
p := etagPath()
|
|
||||||
err := os.WriteFile(p, []byte(strings.TrimSuffix(etag, "\n")), 0o600)
|
|
||||||
if err != nil {
|
|
||||||
log.Debugf("Unable to save etag to %s: %e", p, err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func etagPath() string {
|
|
||||||
dir := filepath.Join(CacheHomeDir, "act")
|
|
||||||
if err := os.MkdirAll(dir, 0o777); err != nil {
|
|
||||||
log.Fatal(err)
|
|
||||||
}
|
|
||||||
return filepath.Join(dir, ".notices.etag")
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
package cmd
|
|
||||||
|
|
||||||
import (
|
|
||||||
"strings"
|
|
||||||
)
|
|
||||||
|
|
||||||
func (i *Input) newPlatforms() map[string]string {
|
|
||||||
platforms := map[string]string{
|
|
||||||
"ubuntu-latest": "node:16-buster-slim",
|
|
||||||
"ubuntu-22.04": "node:16-bullseye-slim",
|
|
||||||
"ubuntu-20.04": "node:16-buster-slim",
|
|
||||||
"ubuntu-18.04": "node:16-buster-slim",
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, p := range i.platforms {
|
|
||||||
pParts := strings.Split(p, "=")
|
|
||||||
if len(pParts) == 2 {
|
|
||||||
platforms[strings.ToLower(pParts[0])] = pParts[1]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return platforms
|
|
||||||
}
|
|
||||||
Loaded 50 of 1907 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user