Compare commits

...
280 Commits
Author SHA1 Message Date
Marcus Young e4df714376 [Automated 🤖 ] Bump to version 2.327.0 2025-07-22 13:50:50 -05:00
myoung34andGitHub 176b4f862d Merge pull request #465 from ElsevierAlex/allow-runner-name-without-prefix
Allow hostname without github-runner prefix to avoid 64-char limit
2025-07-14 08:01:53 -05:00
chorbea bf1835f3ee Defaulted RUNNER_NAME_PREFIX 2025-07-14 09:23:52 +01:00
Marcus Young 1113f5896b [Automated 🤖 ] Bump to version 2.326.0 2025-07-07 15:19:13 -05:00
chorbea a4c88c50ff allow hostname without github-runner prefix to avoid 64-char limit 2025-07-04 10:11:55 +01:00
myoung34andGitHub 6510abfa97 Merge pull request #464 from myoung34/renovate/github-codeql-action-3.x
Update github/codeql-action action to v3.29.2
2025-07-02 20:25:12 -04:00
renovate[bot]andGitHub 1e5aef7fd9 Update github/codeql-action action to v3.29.2 2025-06-30 16:25:17 +00:00
myoung34andGitHub 767b90dc11 Merge pull request #463 from myoung34/renovate/github-codeql-action-3.x
Update github/codeql-action action to v3.29.1
2025-06-27 06:55:11 -05:00
renovate[bot]andGitHub c4cde09fb4 Update github/codeql-action action to v3.29.1 2025-06-27 11:46:24 +00:00
myoung34andGitHub 93215e94d9 Merge pull request #461 from myoung34/renovate/docker-setup-buildx-action-3.x
Update docker/setup-buildx-action action to v3.11.1
2025-06-18 10:56:12 -05:00
renovate[bot]andGitHub cb4c4ac8ed Update docker/setup-buildx-action action to v3.11.1 2025-06-18 13:43:01 +00:00
myoung34andGitHub ba68ffeb81 Merge pull request #460 from myoung34/renovate/docker-setup-buildx-action-3.x
Update docker/setup-buildx-action action to v3.11.0
2025-06-16 14:12:03 -05:00
renovate[bot]andGitHub 6311c21d14 Update docker/setup-buildx-action action to v3.11.0 2025-06-16 19:07:01 +00:00
myoung34andGitHub b3c7474675 Merge pull request #458 from myoung34/renovate/github-codeql-action-3.x
Update github/codeql-action action to v3.29.0
2025-06-11 17:17:04 -05:00
renovate[bot]andGitHub b67116f6e4 Update github/codeql-action action to v3.29.0 2025-06-11 22:03:48 +00:00
myoung34andGitHub 1d9e8868ad Merge pull request #457 from myoung34/renovate/github-codeql-action-3.x
Update github/codeql-action action to v3.28.19
2025-06-03 10:20:18 -05:00
renovate[bot]andGitHub 2d4990e197 Update github/codeql-action action to v3.28.19 2025-06-03 15:10:37 +00:00
Marcus Young 7e5779b170 [Automated 🤖 ] Bump to version 2.325.0 2025-06-02 13:48:39 -05:00
myoung34andGitHub 56233b5a1c Merge pull request #455 from SaschaHenning/master
Fix RUNNER_WORKDIR not created if part of the folder structure is nonexisting
2025-05-22 09:54:58 -05:00
Sascha HenningandGitHub 2b0f61916a fix RUNNER_WORKDIR not created if parent folder does not exist 2025-05-20 15:01:32 +02:00
myoung34andGitHub d49ef96679 Merge pull request #454 from myoung34/renovate/github-codeql-action-3.x
Update github/codeql-action action to v3.28.18
2025-05-19 11:22:45 -05:00
renovate[bot]andGitHub f66226db9c Update github/codeql-action action to v3.28.18 2025-05-16 14:56:08 +00:00
Marcus Young de943e2e38 [Automated 🤖 ] Bump to version 2.324.0 2025-05-13 00:27:05 -05:00
myoung34andGitHub d9094bd6dd Merge pull request #448 from myoung34/renovate/github-codeql-action-3.x
Update github/codeql-action action to v3.28.17
2025-05-02 06:21:22 -04:00
renovate[bot]andGitHub 46bb16d631 Update github/codeql-action action to v3.28.17 2025-05-02 09:58:26 +00:00
renovate[bot]GitHubrenovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
b304a0e3f1 Update actions/setup-python action to v5.6.0 (#447)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-24 14:31:26 +00:00
myoung34andGitHub 67197609ff Merge pull request #446 from myoung34/renovate/github-codeql-action-3.x
Update github/codeql-action action to v3.28.16
2025-04-23 08:07:01 -05:00
renovate[bot]andGitHub 4aa08f7b87 Update github/codeql-action action to v3.28.16 2025-04-23 12:48:24 +00:00
myoung34andGitHub c07669d21e Merge pull request #444 from myoung34/renovate/github-codeql-action-3.x
Update github/codeql-action action to v3.28.15
2025-04-07 20:42:58 -05:00
renovate[bot]andGitHub afe24fb382 Update github/codeql-action action to v3.28.15 2025-04-07 22:49:35 +00:00
myoung34andGitHub 4593a2c53b Merge pull request #443 from myoung34/renovate/github-codeql-action-3.x
Update github/codeql-action action to v3.28.14
2025-04-07 09:06:09 -05:00
renovate[bot]andGitHub febe59b6f2 Update github/codeql-action action to v3.28.14 2025-04-07 10:01:29 +00:00
renovate[bot]GitHubrenovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
abf6f7ef87 Update actions/setup-python action to v5.5.0 (#441)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-25 10:46:47 +00:00
renovate[bot]GitHubrenovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
8969c0a49b Update github/codeql-action action to v3.28.13 (#439)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-24 22:14:27 +00:00
myoung34andGitHub ac1308d764 Merge pull request #438 from myoung34/renovate/github-codeql-action-3.x
Update github/codeql-action action to v3.28.12
2025-03-20 15:45:29 -05:00
renovate[bot]andGitHub c90771d489 Update github/codeql-action action to v3.28.12 2025-03-19 18:39:17 +00:00
Mark Young 5869f38e4b [Automated 🤖 ] Bump to version 2.323.0 2025-03-19 13:38:45 -05:00
Mark Young 9e608c3a82 Move final actions to SHA's 2025-03-17 11:11:33 -05:00
Mark Young b65e08bc91 Add codeql to flag unpinned actions refs 2025-03-17 09:15:06 -05:00
myoung34andGitHub 9270f9a7a7 Merge pull request #437 from myoung34/renovate/docker-setup-qemu-action-3.x
Update docker/setup-qemu-action action to v3.6.0
2025-03-17 08:56:15 -05:00
myoung34andGitHub 4e8ac02be6 Merge pull request #436 from myoung34/renovate/docker-setup-buildx-action-3.x
Update docker/setup-buildx-action action to v3.10.0
2025-03-17 08:56:08 -05:00
myoung34andGitHub 6c30d2e070 Merge pull request #435 from myoung34/renovate/docker-login-action-3.x
Update docker/login-action action to v3.4.0
2025-03-17 08:56:00 -05:00
renovate[bot]andGitHub 5aadc7f42b Update docker/setup-qemu-action action to v3.6.0 2025-03-17 13:55:49 +00:00
myoung34andGitHub 66eb4f5a2f Merge pull request #434 from myoung34/renovate/actions-stale-9.x
Update actions/stale action to v9.1.0
2025-03-17 08:55:47 -05:00
renovate[bot]andGitHub e42df8f308 Update docker/setup-buildx-action action to v3.10.0 2025-03-17 13:55:43 +00:00
myoung34andGitHub feedfa66f0 Merge pull request #433 from myoung34/renovate/actions-setup-python-5.x
Update actions/setup-python action to v5.4.0
2025-03-17 08:55:41 -05:00
renovate[bot]andGitHub 1f125c1391 Update docker/login-action action to v3.4.0 2025-03-17 13:55:38 +00:00
renovate[bot]andGitHub 9d6d26c2d4 Update actions/stale action to v9.1.0 2025-03-17 13:55:33 +00:00
renovate[bot]andGitHub 5cfbf3423a Update actions/setup-python action to v5.4.0 2025-03-17 13:55:30 +00:00
myoung34andGitHub ad78bd8fd8 Merge pull request #432 from myoung34/renovate/actions-create-release-1.x
Update actions/create-release action to v1.1.4
2025-03-17 08:55:25 -05:00
myoung34andGitHub 90fdc6b19c Merge pull request #431 from myoung34/renovate/actions-checkout-4.x
Update actions/checkout action to v4.2.2
2025-03-17 08:55:13 -05:00
myoung34andGitHub 8a526ec997 Merge pull request #430 from myoung34/renovate/nick-fields-retry-3.x
Update nick-fields/retry action to v3.0.2
2025-03-17 08:55:03 -05:00
renovate[bot]andGitHub 9c9369a0e3 Update actions/create-release action to v1.1.4 2025-03-17 13:53:52 +00:00
renovate[bot]andGitHub a79e0182bf Update actions/checkout action to v4.2.2 2025-03-17 13:53:49 +00:00
renovate[bot]andGitHub 2b58586d88 Update nick-fields/retry action to v3.0.2 2025-03-17 13:53:45 +00:00
myoung34andGitHub c1292d5720 Merge pull request #429 from myoung34/renovate/pin-dependencies
Pin dependencies
2025-03-17 08:53:12 -05:00
renovate[bot]andGitHub e8e9da59f0 Pin dependencies 2025-03-17 13:27:33 +00:00
Mark Young d8df91da6d Set renovate to prefer github actions sha's 2025-03-17 08:26:55 -05:00
myoung34andGitHub 651dbe1fdf Merge pull request #427 from myoung34/fix_deregistration_on_reusable
Force DISABLE_AUTOMATIC_DEREGISTRATION to be true on reusable runners, add tests
2025-02-24 11:56:18 -06:00
Mark Young 9ed37bca4c Force DISABLE_AUTOMATIC_DEREGISTRATION to be true on reusable runners, add tests 2025-02-24 11:19:25 -06:00
Mark Young b9c038dfd3 Fix remaining qemu libc-bin runs 2025-02-19 17:30:16 -06:00
myoung34andGitHub 38e96633b7 Merge pull request #425 from myoung34/libc-bin_segfault
Attempt to fix GHA segfault
2025-02-19 17:03:43 -06:00
Mark Young fb13e93b86 Fix GHA segfault on ubuntu-jammy for libc-bin
* backtrack binfmt to v7 via https://github.com/tonistiigi/binfmt/issues/240
2025-02-19 09:50:25 -06:00
Marcus Young c3436f8af3 [Automated 🤖 ] Bump to version 2.322.0 2025-01-24 09:00:57 -06:00
myoung34andGitHub 1a5ad74d28 Merge pull request #417 from myoung34/fix_debian_sid
Fix debian sid
2024-12-11 16:44:11 -05:00
Mark Young 50340d28c3 Fix debian sid 2024-12-11 15:59:31 -05:00
Marcus Young ec7f582118 [Automated 🤖 ] Bump to version 2.321.0 2024-11-13 10:37:31 -07:00
myoung34andGitHub c36f07ff88 Merge pull request #408 from myoung34/renovate/actions-checkout-digest
Update actions/checkout digest to 11bd719
2024-10-23 11:53:12 -05:00
renovate[bot]andGitHub 1c4008bc0b Update actions/checkout digest to 11bd719 2024-10-23 16:50:20 +00:00
myoung34andGitHub 8873f648e7 Merge pull request #404 from myoung34/renovate/actions-checkout-digest
Update actions/checkout digest to eef6144
2024-10-07 13:49:32 -05:00
renovate[bot]andGitHub 90e9fe160a Update actions/checkout digest to eef6144 2024-10-07 18:40:39 +00:00
myoung34andGitHub 47ce625b58 Merge pull request #403 from bodograumann/patch-1
Make sure there is no remnant runner config before configuring
2024-10-06 14:06:40 -05:00
Bodo Graumann c6f70ddb46 Apply suggestions from PR 2024-10-05 20:08:27 +02:00
Bodo GraumannandGitHub d4ee023016 Make sure there is no remnant runner config before configuring
Closes #402
2024-10-05 09:25:14 +02:00
Marcus Young 706339b472 [Automated 🤖 ] Bump to version 2.320.0 2024-10-03 14:56:00 -05:00
myoung34andGitHub a164a11b6b Merge pull request #399 from myoung34/readme_update
Add information on how to view and modify the included packages and configuration
2024-09-27 06:26:14 -05:00
Marcus Young c9036e711f Add information on how to view and modify the included packages and configuration 2024-09-27 06:25:45 -05:00
myoung34andGitHub a55d4f9a42 Merge pull request #393 from vyadh/config-driven-install
Config driven install
2024-09-26 16:14:54 -05:00
Kieron Wilkinson b34e2f59c1 Added script source for software installs via config.json 2024-09-26 21:24:12 +01:00
Kieron Wilkinson 11d8d4c524 Select apt packages to install from config.json 2024-09-26 21:24:12 +01:00
Kieron Wilkinson 29667cc827 Created a build config file with initially user and group id.
This allows users to specify ids that are consistent with their host users
2024-09-26 21:24:11 +01:00
myoung34andGitHub 5615bd29fd Merge pull request #398 from myoung34/fix_readme
Fix readme for tests
2024-09-25 08:40:48 -05:00
Marcus Young e40248bf5b Fix readme for tests 2024-09-25 08:40:29 -05:00
myoung34andGitHub cf3f558db2 Merge pull request #395 from myoung34/goss_deprecation
Goss: change deprecated file.contains to file.contents
2024-09-23 08:00:07 -05:00
Marcus Young 156484048d Goss: change deprecated file.contains to file.contents 2024-09-20 22:02:21 -05:00
myoung34andGitHub c54340de85 Merge pull request #394 from myoung34/retry_buildx
Wrap all tests and docker/build-push-action into  nick-fields/retry
2024-09-10 15:13:03 -05:00
Marcus Young 4ef971402a Wrap all tests and docker/build-push-action into nick-fields/retry 2024-09-10 13:02:36 -05:00
myoung34andGitHub a7d71289d1 Merge pull request #391 from myoung34/test_dir
Fix temp dir location for tests
2024-09-09 13:33:36 -05:00
Mark Young 583d899630 Fix temp dir location for tests 2024-09-09 13:33:24 -05:00
myoung34andGitHub 560b1e0287 Merge pull request #390 from myoung34/add_dir_test
Add runner dir test output to goss
2024-09-09 11:35:21 -05:00
Marcus Young c69304a308 Add runner dir test output to goss 2024-09-09 11:34:02 -05:00
myoung34andGitHub a8e227675c Merge pull request #385 from vyadh/install-scripts
Refactored to a set of install scripts to avoid adding further complexity to the base Dockerfile and make it easier to disable tools
2024-09-06 21:54:22 -05:00
Kieron Wilkinson 3f73ad68c9 Fixed shellcheck issues 2024-09-06 21:03:14 +01:00
Kieron Wilkinson 0bcea869f0 Refactored Dockerfile.base install into dedicated scripts
Additionally, this change:
- Configures upfront to reduce number of apt updates
- Removes use of lsb-release to allow simplification and avoid unnecessary dependencies in the base image (i.e. Python)
2024-09-06 16:56:19 +01:00
myoung34andGitHub b8ce68480a Merge pull request #384 from yamoyamoto/chore/unset-envs-before-launch-service
feat: Prevent exposure of configuration environment variables to runner workflows
2024-09-06 06:21:53 -05:00
tomoya-kawaguchi 35c099d07e chore: use local var 2024-09-06 16:56:27 +09:00
tomoya-kawaguchi bf069ba26b docs: add UNSET_CONFIG_VARS settings 2024-09-06 16:56:27 +09:00
tomoya-kawaguchi a3360fccaa chore: unset configuration environment variables if flag is set 2024-09-06 16:54:52 +09:00
myoung34andGitHub ab85a5a708 Merge pull request #389 from myoung34/base_and_defaults_test
Remove the final command test from the base, make it a "defaults" test
2024-09-05 12:41:25 -05:00
Mark Young e36338743e Remove the final command test from the base, make it a "defaults" test 2024-09-05 12:40:05 -05:00
myoung34andGitHub 75bcd96989 Merge pull request #388 from myoung34/bugfix/platforms_slash
Bugfix: fix platforms to remove slash
2024-09-05 12:34:05 -05:00
Mark Young 78d8042a48 Bugfix: fix platforms to remove slash 2024-09-05 12:33:41 -05:00
myoung34andGitHub 1ec6d387e6 Merge pull request #387 from myoung34/goss_tests
Add goss tests
2024-09-05 11:59:50 -05:00
Marcus Young 0a4919d643 Add vars file for os,oscodename,arch in test matrix 2024-09-05 11:07:11 -05:00
Marcus Young 87dcaa1bb5 Add goss tests 2024-09-05 10:01:22 -05:00
Marcus Young eb29a1af8c [Automated 🤖 ] Bump to version 2.319.1 2024-08-13 11:35:11 -05:00
Marcus Young 2fd4bf229b [Automated 🤖 ] Bump to version 2.319.0 2024-08-08 09:19:26 -05:00
Marcus Young 97002e8519 [Automated 🤖 ] Bump to version 2.318.0 2024-07-26 08:12:10 -07:00
Marcus Young 5fb8b0a1b1 Add stale-exempt label for pr/issue exemptions 2024-06-29 08:29:08 -05:00
Marcus Young b53db30fa5 Turn on stale bot 2024-06-20 20:39:58 -05:00
Marcus Young 6043dbb3b9 Add stale bot 2024-06-18 05:57:20 -05:00
myoung34andGitHub e47abb3ec3 Merge pull request #374 from myoung34/renovate/docker-build-push-action-6.x
Update docker/build-push-action action to v6
2024-06-17 07:18:03 -05:00
renovate[bot]andGitHub 453428ac0f Update docker/build-push-action action to v6 2024-06-17 09:51:58 +00:00
myoung34andGitHub 83d5d17770 Merge pull request #372 from myoung34/renovate/actions-checkout-digest
Update actions/checkout digest to 692973e
2024-06-13 12:42:38 -05:00
renovate[bot]andGitHub 54e9ded780 Update actions/checkout digest to 692973e 2024-06-13 17:21:46 +00:00
Marcus Young dc5c5ebb26 [Automated 🤖 ] Bump to version 2.317.0 2024-05-30 09:08:24 -05:00
myoung34andGitHub 2550895e91 Merge pull request #368 from myoung34/renovate/actions-checkout-digest
Update actions/checkout digest to a5ac7e5
2024-05-20 13:30:36 -05:00
renovate[bot]andGitHub bdf0df2465 Update actions/checkout digest to a5ac7e5 2024-05-20 18:29:50 +00:00
Marcus Young 9efb8bf081 Attempt to clean up ubuntu-isms 2024-05-16 10:49:44 -05:00
Marcus Young 2391c0c5a1 Remove bullseye ahead of June security EOL 2024-05-15 20:10:39 -05:00
myoung34andGitHub a5aa5cee61 Merge pull request #366 from MattKobayashi/debian-bookworm
Add Debian `bookworm` runner
2024-05-15 19:07:55 -05:00
Matthew Kobayashi 9114ab1b9e Add Debian bookworm runner 2024-05-15 23:23:07 +08:00
myoung34andGitHub b5efdc8002 Merge pull request #364 from myoung34/renovate/actions-checkout-digest
Update actions/checkout digest to 0ad4b8f
2024-05-09 14:06:06 -05:00
renovate[bot]andGitHub 8226e09b61 Update actions/checkout digest to 0ad4b8f 2024-05-09 17:44:24 +00:00
myoung34andGitHub e850becbda Merge pull request #362 from myoung34/renovate/actions-checkout-digest
Update actions/checkout digest to 44c2b7a
2024-05-08 17:21:06 -05:00
renovate[bot]andGitHub 830b5ce645 Update actions/checkout digest to 44c2b7a 2024-05-08 21:58:46 +00:00
Marcus Young 8af3f260bc [Automated 🤖 ] Bump to version 2.316.1 2024-05-02 12:56:23 -05:00
myoung34andGitHub 2cac13888e Merge pull request #361 from hisa9chi/fix-typo-powershell
Fix : typo env PWSH_DOWNLOAD_URL
2024-04-30 20:38:17 -05:00
Hisashi IguchiandGitHub 7f30dee2ad fix typo PWSH_DOWNLOAD_URL 2024-05-01 09:41:30 +09:00
myoung34andGitHub ec7e410e7c Merge pull request #360 from hisa9chi/add-powershell
feat: added PowerShell/PowerShell
2024-04-30 08:32:57 -05:00
hisa9chi 5027295682 deletel rm command 2024-04-30 22:31:40 +09:00
hisa9chi 34a90a6940 add powershell 2024-04-30 21:27:41 +09:00
myoung34andGitHub 9356c3c1e4 Merge pull request #357 from myoung34/deprecate_bionic
Ubuntu: Move bionic to noble
2024-04-25 21:11:19 -05:00
Marcus Young 07c8540e6d Ubuntu: Move bionic to noble 2024-04-25 21:10:57 -05:00
myoung34andGitHub 2ea29d01f4 Merge pull request #355 from myoung34/renovate/actions-checkout-digest
Update actions/checkout digest to 0ad4b8f
2024-04-25 11:12:12 -05:00
renovate[bot]andGitHub 25a75dfd9d Update actions/checkout digest to 0ad4b8f 2024-04-25 16:10:29 +00:00
myoung34andGitHub 071e3436f2 Merge pull request #354 from chinochao/fix-ulimit
Fix Docker Ulimit Invalid Argument
2024-04-25 11:10:09 -05:00
Marcus Young d5709bcff5 Add better signal trap for debugging 2024-04-25 11:02:50 -05:00
Roberto Chaud 28e1d3f9fb commend out ulimit -Hn 2024-04-24 12:58:41 -05:00
myoung34andGitHub 0b7a6e5195 Merge pull request #351 from myoung34/renovate/actions-checkout-digest
Update actions/checkout digest to 1d96c77
2024-04-23 14:48:53 -05:00
renovate[bot]andGitHub 931a9598f1 Update actions/checkout digest to 1d96c77 2024-04-23 15:59:26 +00:00
Marcus Young f788148b2c [Automated 🤖 ] Bump to version 2.316.0 2024-04-23 10:59:01 -05:00
Marcus Young e38ae432d7 [Automated 🤖 ] Bump to version 2.315.0 2024-03-26 14:23:04 -05:00
myoung34andGitHub 122b1e3055 Merge pull request #348 from myoung34/renovate/shellcheck-0.x
Update dependency shellcheck to v0.10.0
2024-03-07 21:37:25 -06:00
renovate[bot]andGitHub 8eb278d63a Update dependency shellcheck to v0.10.0 2024-03-08 03:25:55 +00:00
myoung34andGitHub f6dd276dca Merge pull request #346 from mattseymour/patch-1
Update README.md
2024-02-28 08:51:48 -06:00
Matt SeymourandGitHub e51fe624fb Update README.md 2024-02-28 14:48:10 +00:00
Matt SeymourandGitHub 88532c5a72 Update README.md
Fix typos and update the argument description for RUNNER_SCOPE.
2024-02-28 14:27:21 +00:00
Marcus Young d259f87e8d [Automated 🤖 ] Bump to version 2.314.1 2024-02-27 14:34:04 -06:00
Marcus Young dac70ea65f [Automated 🤖 ] Bump to version 2.314.0 2024-02-26 12:56:43 -06:00
Marcus Young 79c6aa0f01 [Automated 🤖 ] Bump to version 2.313.0 2024-02-07 14:32:31 -06:00
myoung34andGitHub 323b49ed6b Merge pull request #345 from myoung34/renovate/pre-commit-action-3.x
Update pre-commit/action action to v3.0.1
2024-02-07 10:43:48 -06:00
renovate[bot]andGitHub aaf2b396be Update pre-commit/action action to v3.0.1 2024-02-07 16:41:40 +00:00
Marcus Young d94a401f6f [Automated 🤖 ] Bump to version 2.312.0 2024-01-16 22:00:30 -06:00
Marcus Young c41e856125 Fix trailing whitespace 2023-12-18 09:27:50 -06:00
myoung34andGitHub 57718010ff Merge pull request #342 from romangarcia/patch-1
Install python3-venv
2023-12-18 08:37:48 -06:00
Roman GarciaandGitHub 0e9edbb2d6 Install python3-venv
The proposed change installs python3-venv, on top of python3, which is a requirement for cfn-linter (and probably others?)

Without it, the error shows:
```
Run scottbrenner/cfn-lint-action@v2
##[add-matcher]/_work/yopdev-cicd-runner--aIk16GWGgIQZE/_actions/scottbrenner/cfn-lint-action/v2/.github/cfn-lint.json
##[debug]Added matchers: 'cfn-lint', 'cfn-lint-warnings'. Problem matchers scan action output for known warning or error strings and report these inline.
/usr/bin/python3 --version
Python 3.8.10
/usr/bin/python3 -m venv /tmp/setup-cfn-lint-QLO4Gb/.venv
The virtual environment was not created successfully because ensurepip is not
available.  On Debian/Ubuntu systems, you need to install the python3-venv
package using the following command.

    apt install python3.8-venv

You may need to use sudo with that command.  After installing the python3-venv
package, recreate your virtual environment.
```
2023-12-15 14:37:12 -03:00
Marcus Young 598b775626 License to gpl-3 2023-12-15 11:17:32 -06:00
myoung34andGitHub e645b78f44 Merge pull request #341 from ponkio-o/add-yq
feat: added mikefarah/yq
2023-12-13 11:33:54 -06:00
ponkio-o 8967a09816 feat: added mikefarah/yq 2023-12-13 17:21:03 +09:00
myoung34andGitHub 5c74c875b4 Merge pull request #340 from myoung34/renovate/actions-setup-python-5.x
Update actions/setup-python action to v5
2023-12-06 07:00:51 -06:00
renovate[bot]andGitHub 44d28a0402 Update actions/setup-python action to v5 2023-12-06 12:58:12 +00:00
myoung34andGitHub 708d0802d6 Merge pull request #338 from Daniel-Aaron-Bloom/master
feat: add `pkg-config` to `Dockerfile.base`
2023-11-20 15:37:53 -06:00
Daniel Bloom eab2dca381 whitespace 2023-11-20 12:21:45 -08:00
Daniel Bloom 935a24dcce feat: add pkg-config to Dockerfile.base 2023-11-20 12:13:31 -08:00
Marcus Young ca7bcb749e Add mirrors for apt keyserver 2023-11-11 07:53:02 -06:00
myoung34andGitHub 4dafa619e2 Merge pull request #333 from JasonCubic/jasoncubic/feature/no-default-labels
Jasoncubic/feature/no default labels
2023-10-31 08:29:03 -05:00
Jason CubicandGitHub 42d22e33bb Update README.md
docs for no default labels option
2023-10-26 16:49:08 -07:00
Jason CubicandGitHub 93555f97f1 Update entrypoint.sh
added truth check to disable adding default labels
2023-10-26 16:48:10 -07:00
Marcus Young 9344afdc50 [Automated 🤖 ] Bump to version 2.311.0 2023-10-23 13:21:32 -05:00
myoung34andGitHub 52d87d6727 Merge pull request #332 from myoung34/renovate/actions-checkout-digest
Update actions/checkout digest to b4ffde6
2023-10-19 06:34:05 -05:00
renovate[bot]andGitHub b309ff2df9 Update actions/checkout digest to b4ffde6 2023-10-19 11:33:16 +00:00
myoung34andGitHub b5f81fb112 Merge pull request #329 from Zhreyu/master
Enhancement of CONTRIBUTING.md Guidelines
2023-10-10 15:14:42 -04:00
Shreyas SandGitHub 19940c2f55 Update CONTRIBUTING.md 2023-10-11 00:28:18 +05:30
Shreyas SandGitHub f1cd067454 Update CONTRIBUTING.md 2023-10-11 00:27:16 +05:30
Marcus Young 07278d23d5 [Automated 🤖 ] Bump to version 2.310.2 2023-10-10 13:33:59 -05:00
Marcus Young cb6af2d89e [Automated 🤖 ] Bump to version 2.310.1 2023-10-10 10:31:49 -05:00
Marcus Young c35d11b3e0 [Automated 🤖 ] Bump to version 2.310.0 2023-10-09 08:50:28 -05:00
myoung34andGitHub 6ceb1d22be Merge pull request #324 from myoung34/renovate/actions-checkout-digest
Update actions/checkout digest to 8ade135
2023-09-22 15:52:03 -05:00
renovate[bot]andGitHub 8434e76f7a Update actions/checkout digest to 8ade135 2023-09-22 18:14:28 +00:00
myoung34andGitHub 96599f2388 Merge pull request #319 from myoung34/renovate/docker-login-action-3.x
Update docker/login-action action to v3
2023-09-12 07:12:56 -05:00
myoung34andGitHub 18d9460fdb Merge pull request #320 from myoung34/renovate/docker-setup-buildx-action-3.x
Update docker/setup-buildx-action action to v3
2023-09-12 07:12:46 -05:00
myoung34andGitHub 5cf71789a5 Merge pull request #321 from myoung34/renovate/docker-setup-qemu-action-3.x
Update docker/setup-qemu-action action to v3
2023-09-12 07:12:33 -05:00
renovate[bot]andGitHub bcabaf3047 Update docker/setup-qemu-action action to v3 2023-09-12 12:06:40 +00:00
renovate[bot]andGitHub a822249136 Update docker/setup-buildx-action action to v3 2023-09-12 12:06:36 +00:00
myoung34andGitHub 16bf61e038 Merge pull request #318 from myoung34/renovate/docker-build-push-action-5.x
Update docker/build-push-action action to v5
2023-09-12 07:06:22 -05:00
renovate[bot]andGitHub 3d633a3532 Update docker/login-action action to v3 2023-09-12 11:00:33 +00:00
renovate[bot]andGitHub 53fcddcca7 Update docker/build-push-action action to v5 2023-09-12 11:00:28 +00:00
Marcus Young af64b04ec6 [Automated 🤖 ] Bump to version 2.309.0 2023-09-07 11:43:47 -05:00
myoung34andGitHub 0e877f4aef Merge pull request #316 from myoung34/renovate/actions-checkout-4.x
Update actions/checkout action to v4
2023-09-04 08:26:43 -05:00
renovate[bot]andGitHub 33822a9108 Update actions/checkout action to v4 2023-09-04 13:23:17 +00:00
myoung34andGitHub 7e82d769c6 Merge pull request #315 from kmkacpermajor/master
Docker service dying fix
2023-09-02 10:12:00 -05:00
myoung34andGitHub c3ed823392 Update entrypoint.sh 2023-09-02 10:11:54 -05:00
kmkacpermajor 359b93cb8b fix 2023-08-25 19:12:33 +02:00
Marcus Young fa3beacfc7 [Automated 🤖 ] Bump to version 2.308.0 2023-08-14 05:50:45 -05:00
Marcus Young b0620cddd3 [Automated 🤖 ] Bump to version 2.307.1 2023-07-25 07:46:20 -05:00
Marcus Young 69c6706a93 [Automated 🤖 ] Bump to version 2.307.0 2023-07-24 06:35:29 -05:00
myoung34andGitHub 19e72e593a Merge pull request #312 from myoung34/renovate/actions-setup-python-4.x
Update actions/setup-python action to v4
2023-07-21 09:48:31 -05:00
renovate[bot]andGitHub a32f033a3a Update actions/setup-python action to v4 2023-07-21 14:47:46 +00:00
myoung34andGitHub d8f341cb13 Merge pull request #309 from myoung34/renovate/shellcheck-0.x
Update dependency shellcheck to v0.9.0
2023-07-21 09:46:53 -05:00
renovate[bot]andGitHub 691f0a2d0a Update dependency shellcheck to v0.9.0 2023-07-21 14:46:37 +00:00
myoung34andGitHub 2f5a5357f2 Merge pull request #310 from myoung34/renovate/actions-checkout-3.x
Update actions/checkout action to v3
2023-07-21 09:46:24 -05:00
renovate[bot]andGitHub e4c1b47fb1 Update actions/checkout action to v3 2023-07-21 14:43:53 +00:00
Marcus Young 816ea853f8 Add renovate 2023-07-21 09:43:35 -05:00
Marcus Young f5245230fa Fix dockerfile base for sid -> trixie 2023-07-18 10:19:28 -05:00
Marcus Young 003622052f [Automated 🤖 ] Bump to version 2.306.0 2023-07-07 06:54:34 -05:00
myoung34andGitHub 28036a223a Merge pull request #305 from myoung34/usr_path_fix
Fix path to chown for debian and ubuntu delta
2023-06-16 07:56:53 -05:00
Marcus Young 3849a3bb3a Ignore "Dockerfile.base:14 SC2015 info: Note that A && B || C is not if-then-else. C may run when A is true." 2023-06-16 07:55:59 -05:00
Marcus Young 19fbe505ed Fix path to chown for debian and ubuntu delta 2023-06-16 07:51:55 -05:00
Marcus Young c31412d677 [Automated 🤖 ] Bump to version 2.305.0 2023-06-14 08:23:41 -05:00
Marcus Young ca0201ca61 Clean up third party repos in base image 2023-06-09 07:19:50 -05:00
myoung34andGitHub 8a60195729 Merge pull request #302 from cloudsbird/master
feat: add the libpq-dev into dockerfile base
2023-05-25 06:23:58 -05:00
Vederis LeunardusandGitHub ec6a3c2b02 feat: add the libpq-dev into dockerfile base 2023-05-25 15:49:04 +08:00
myoung34andGitHub 869eed00ad Merge pull request #298 from LordChunk/pr/start-docker-with-env
Start Docker service with env variable
2023-05-16 11:23:40 -05:00
JobandGitHub 02345f60eb Added START_DOCKER_SERVICE to explanation 2023-05-16 12:18:44 +02:00
Job ce3fa67d01 Revert "Added steps for converting org and repo name to lower case"
This reverts commit 25ced0a285.
2023-05-15 21:41:12 +00:00
Job 0defbf05c9 Moved Docker start command before runner start 2023-05-15 21:14:08 +00:00
Job 25ced0a285 Added steps for converting org and repo name to lower case 2023-05-15 20:44:12 +00:00
Job 6f041688da Added ability to start docker service on startup 2023-05-15 19:59:54 +00:00
Marcus Young 9cb13e5d9d Bump docker/login-action@v1 to docker/login-action@v2 2023-05-03 09:38:07 -05:00
Marcus Young bede34073e Bump setup-buildx-action to v2, build-push-action to v4 2023-05-03 09:26:01 -05:00
Marcus Young aff2a788bf bump qemu action to v2 2023-05-03 09:22:16 -05:00
myoung34andGitHub a911c0ae52 Merge pull request #293 from viseshrp/patch-1
remove warning about compose on ARM
2023-04-30 15:15:02 -05:00
Visesh RajendraprasadandGitHub 558d9c966b remove warning about compose on ARM 2023-04-30 16:07:00 -04:00
Marcus Young e929641491 [Automated 🤖 ] Bump to version 2.304.0 2023-04-26 15:10:05 -05:00
myoung34andGitHub 4d04be45b3 Merge pull request #292 from wico-silva/fix/docker-compose-shebang
Fix docker compose shebang
2023-04-26 05:39:53 -05:00
David Silva c6c8324c99 Fix docker compose shebang 2023-04-13 16:37:11 +02:00
myoung34andGitHub 9a1f879815 Merge pull request #289 from barnesew/update-docker-compose
Update Docker Compose to v2
2023-03-28 14:06:37 -05:00
Evan Barnes 182f60392a Changing docker-compose script directory to /usr/local/bin. 2023-03-28 11:18:49 -04:00
Evan Barnes bdeda7540b Installing docker compose via the docker plugin and creating compatibility command for "docker-compose". 2023-03-28 10:34:41 -04:00
Koen De VleeschauwerandMarcus Young 37c5c6cedf add whitespace around gh version number
Co-authored-by: myoung34 <myoung34@my.apsu.edu>
2023-03-17 13:14:52 -05:00
Marcus Young ca56e475d5 [Automated 🤖 ] Bump to version 2.303.0 2023-03-10 05:09:42 -06:00
myoung34andGitHub 123abdad71 Merge pull request #285 from ultrr/master
Add docker-buildx-plugin
2023-03-07 10:31:05 -06:00
ultrr bc28f6b970 add docker-buildx-plugin 2023-03-03 09:48:21 +01:00
Marcus Young d6f3aa6c8e [Automated 🤖 ] Bump to version 2.302.1 2023-02-15 10:34:50 -06:00
Marcus Young a4cb10ea80 [Automated 🤖 ] Bump to version 2.302.0 2023-02-14 11:17:26 -06:00
myoung34andGitHub 03a6e8470a Merge pull request #282 from fabfuel/fabfuel/nested-default-branch
Make default workdir a subfolder under /_work
2023-02-10 07:38:31 -06:00
Fabian Fuelling a125d7e21e Make default workdir a subfolder under /_work 2023-02-07 16:00:54 +01:00
myoung34andGitHub 3f79a3e7e5 Merge pull request #276 from myoung34/bugfix/etc_hostname
Bugfix: /etc/hostname is not guaranteed, sane default to random string
2023-01-31 19:22:44 -06:00
Marcus Young 855113b437 Add new boolean for randomized suffix 2023-01-31 08:36:49 -06:00
Marcus Young 90bea89598 Add empty check for /etc/hostname 2023-01-31 08:12:09 -06:00
Marcus Young fb6fdfa1c5 Bugfix: /etc/hostname is not guaranteed, sane default to random string 2023-01-30 11:11:21 -06:00
Marcus Young 8b5cafc897 [Automated 🤖 ] Bump to version 2.301.1 2023-01-18 19:13:36 -06:00
Marcus Young b0f0762e05 [Automated 🤖 ] Bump to version 2.301.0 2023-01-18 14:10:34 -06:00
myoung34andGitHub 1c136849c9 Merge pull request #271 from iamironz/master
Added using docker hostname instead manual generated random
2023-01-16 08:31:20 -06:00
Aleksandr Efremenkov 9175b93a7b added using docker hostname instead manual generated random, updated README 2023-01-16 16:10:48 +02:00
Marcus Young 45574ba8bb Hotfix: fix outdated key for focal on opensuse gpg 2022-12-31 18:59:13 -06:00
Marcus Young ac2e2b9a5d [Automated 🤖 ] Bump to version 2.300.2 2022-12-19 13:27:52 -06:00
Marcus Young 02418d25e4 [Automated 🤖 ] Bump to version 2.300.1 2022-12-19 10:37:02 -06:00
Marcus Young ca30659d4e [Automated 🤖 ] Bump to version 2.300.0 2022-12-14 02:52:06 -06:00
myoung34andGitHub 0bb0b6227b Merge pull request #264 from Abramo-Bagnara/master
Allow to put APP_PRIVATE_KEY in Docker env file. Introduced APP_LOGIN…
2022-12-12 14:56:59 -06:00
myoung34andGitHub b92d9416f7 Merge pull request #268 from lumagi/remove_recursive_chown
Change recursive chown to flat chown for tools directory
2022-12-12 14:50:23 -06:00
Lukas Magel cb7a831054 Change recursive chown to flat chown for tools directory
If the tools cache is already populated with tooling in a derived docker
image, performing a recursive chown significantly slows down ephemeral
runner startup.
2022-12-12 20:52:43 +01:00
Abramo Bagnara c4dad6b826 Added some info about APP_LOGIN in README.md. 2022-12-12 19:03:03 +01:00
Abramo Bagnara b431a190e0 Improved backward compatibility with sane defaults for APP_LOGIN. 2022-12-09 08:08:27 +01:00
myoung34andGitHub b89c3a1c85 Merge pull request #263 from ilyesAj/patch-1
add zip package to dockerfile
2022-12-06 13:39:43 -06:00
myoung34andGitHub 7827dd56fa Merge pull request #265 from nmalaguti/master
Fix expired GPG key for opensuse kubic repository
2022-12-06 12:34:50 -06:00
Nick Malaguti 47b2f1d300 Fix expired GPG key for opensuse kubic repository
https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_20.04/Release.key
expired on 2022-12-06. An updated key with an expiration of 2025-01-30
is available at
https://build.opensuse.org/project/keys_and_certificates/devel:kubic.
2022-12-06 11:39:40 -05:00
Abramo Bagnara c56bb17e42 Allow to put APP_PRIVATE_KEY in Docker env file. Introduced APP_LOGIN to fix access token retrieval in case of multiple GitHub's App subscriber. 2022-12-06 08:50:29 +01:00
ilyes AjroudandGitHub 28f9ffd8d0 add zip package 2022-12-05 15:24:07 +01:00
myoung34andGitHub a7dc4a3dcc Merge pull request #254 from chantra/github_app
Add support for GitHub app authentication
2022-11-11 09:17:41 -05:00
Manu Bretelle fe3e411b16 entrypoint: make APP_ID/APP_PRIVATE_KEY mutually exclusive with
{ACCESS,RUNNER}_TOKEN.

```
$ docker run --env RUNNER_TOKEN=foo --env APP_ID=1234 --env APP_PRIVATE_KEY="$(<~/Downloads/cert.pem)" runner_app
REPO_URL required for repo runners
Runner reusage is disabled
ERROR: ACCESS_TOKEN or RUNNER_TOKEN provided but are mutually exclusive with APP_ID and APP_PRIVATE_KEY.
$ docker run --env ACCESS_TOKEN=foo --env APP_ID=1234 --env APP_PRIVATE_KEY="$(<~/Downloads/cert.pem)" runner_app
REPO_URL required for repo runners
Runner reusage is disabled
ERROR: ACCESS_TOKEN or RUNNER_TOKEN provided but are mutually exclusive with APP_ID and APP_PRIVATE_KEY.
$ docker run --env ACCESS_TOKEN=foo --env APP_ID=1234 --env APP_PRIVATE_KEY="$(<~/Downloads/cert.pem)" runner_app
$ docker run --env APP_ID=250536  runner_app
REPO_URL required for repo runners
Runner reusage is disabled
ERROR: Both APP_ID and APP_PRIVATE_KEY must be specified.
$ docker run --env APP_ID=1234 --env APP_PRIVATE_KEY="$(<~/Downloads/cert.pem)" runner_app

REPO_URL required for repo runners
Runner reusage is disabled
Obtaining access token for app_id 1234
Obtaining the token of the runner
curl: (22) The requested URL returned error: 404
Configuring

--------------------------------------------------------------------------------
|        ____ _ _   _   _       _          _        _   _                      |
|       / ___(_) |_| | | |_   _| |__      / \   ___| |_(_) ___  _ __  ___      |
|      | |  _| | __| |_| | | | | '_ \    / _ \ / __| __| |/ _ \| '_ \/ __|     |
|      | |_| | | |_|  _  | |_| | |_) |  / ___ \ (__| |_| | (_) | | | \__ \     |
|       \____|_|\__|_| |_|\__,_|_.__/  /_/   \_\___|\__|_|\___/|_| |_|___/     |
|                                                                              |
|                       Self-hosted runner registration                        |
|                                                                              |
--------------------------------------------------------------------------------

Invalid configuration provided for url. Terminating unattended configuration.
An error occurred: Not configured. Run config.(sh/cmd) to configure the runner.
```
2022-11-10 13:31:22 -08:00
Manu Bretelle 8e83820e40 Update README.md with PR feedback 2022-11-10 13:31:22 -08:00
Manu Bretelle da04c0609f Fix trailing space in .github/workflows/deploy.yml 2022-11-10 13:31:22 -08:00
Manu Bretelle a283b1d8d0 Update README to document APP_ID/APP_PRIVATE_KEY
Document the new environment variables and highlight the possible
security risk and provide possible mitigations.
2022-11-10 13:31:22 -08:00
Manu Bretelle 516f8f96ac Copy app_token.sh when building the docker image 2022-11-10 13:31:22 -08:00
Manu Bretelle a43f59ceb9 Add suport for using a GitHub app to run the runner.
If both `APP_ID` and `APP_PRIVATE_KEY` are set, `entrypoint.sh` will
fetch an `ACCESS_TOKEN` for the GitHub app using `app_token.sh` script.

`ACCESS_TOKEN` will get set, and `entrypoint.sh` will carry on as it
used to had `ACCESS_TOKEN` been set from the environment variable.
2022-11-10 13:31:22 -08:00
Manu Bretelle ec64392f58 Add a script to fetch an access token for a Github App.
This script will fetch an access token from Github for a Github app.

It is expected that `APP_ID` and `APP_PRIVATE_KEY` environment variables are set.

Running
```
APP_ID=12345 APP_PRIVATE_KEY="$(</path/to/githubapp.pem)" bash ./app_token.sh
```

will generate a token suitable to use as `ACCESS_TOKEN`.
2022-11-10 13:31:22 -08:00
Marcus Young 000e4c0e03 [Automated 🤖 ] Bump to version 2.299.1 2022-11-02 20:06:22 -04:00
Marcus Young ccad12634b [Automated 🤖 ] Bump to version 2.299.0 2022-11-02 15:10:20 -04:00
Marcus Young adff5c97f3 Sid is now bookworm in lsb_release -cs 2022-10-31 10:03:36 -05:00
Marcus Young e44424c8b9 [Automated 🤖 ] Bump to version 2.298.2 2022-10-04 11:52:15 -05:00
Marcus Young f60efe84a9 [Automated 🤖 ] Bump to version 2.298.1 2022-10-04 10:36:00 -05:00
Marcus Young e3f7748492 [Automated 🤖 ] Bump to version 2.298.0 2022-10-04 07:27:21 -05:00
myoung34andGitHub 0f2883e196 Merge pull request #250 from chantra/fix_ephemeral
Fix ephemeral support
2022-10-02 08:31:55 -05:00
chantra 2fc9c11800 Fix ephemeral support
The quotes added in 08608da938 cause
`ephemeral` to evaluate as false when `DISABLE_AUTO_UPDATE` was not set.

This is explained in details in #249. This diff changes the logic to use
an array where extra parameters are being added.
When calling config.sh, the array is expanded.

Testing:
../self_hosted_runner.env contains
```
EPHEMERAL=true
```

Before: https://gist.github.com/chantra/443dfaa60d964d938bcb1c020781ca00
we can see multiple jobs got scheduled on the runner

After: https://gist.github.com/chantra/061dc471c63964c01a2e3733a53bd3ec
we can see that when the job finished, the container shutdown.

After with DISABLE_AUTO_UPDATE set: https://gist.github.com/chantra/df0102c7340b8f6bfd458ec56d9fa29c

Also adding `set -x` before the call to `config.sh` revealed the
arguments were correctly added.

Fixes #249
2022-09-30 14:49:04 -07:00
Marcus Young dafb91bfa3 Hotfix: more lenient sid to bullseye sub 2022-09-28 01:48:12 -05:00
Marcus Young c3c6a4e493 Fix ghcli installer by using API and not html parsing 2022-09-26 12:08:03 -05:00
Marcus Young 087e754f56 Fix permissions for release creation 2022-09-26 11:27:59 -05:00
Marcus Young 5b19b8dafa [Automated 🤖 ] Bump to version 2.297.0 2022-09-26 10:54:33 -05:00
28 changed files with 2426 additions and 311 deletions
+3
View File
@@ -0,0 +1,3 @@
query-filters:
- include:
id: actions/unpinned-tag
+209 -60
View File
@@ -4,6 +4,7 @@ on:
paths:
- Dockerfile.base
- .github/workflows/base.yml
- goss*
branches:
- master
- develop
@@ -11,98 +12,246 @@ on:
- cron: '0 22 * * *'
jobs:
ubuntu_base_latest_deploy:
runs-on: ubuntu-latest
steps:
- name: Copy Repo Files
uses: actions/checkout@master
- name: Get GitHub organization or user
run: echo 'ORG='$(echo $(dirname ${GITHUB_REPOSITORY}) | awk '{print tolower($0)}') >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: Dockerfile.base
pull: true
push: true
tags: ${{ env.ORG }}/github-runner-base:latest
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
ubuntu_base_deploy:
ubuntu_base_tests:
runs-on: ubuntu-latest
strategy:
matrix:
release: [jammy, focal, bionic]
release: [jammy, focal, noble]
platform: [amd64, arm64]
fail-fast: false
steps:
- name: Copy Repo Files
uses: actions/checkout@master
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Get GitHub organization or user
run: echo 'ORG='$(echo $(dirname ${GITHUB_REPOSITORY}) | awk '{print tolower($0)}') >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
with:
image: tonistiigi/binfmt:qemu-v7.0.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
- name: Copy Dockerfile
run: cp Dockerfile.base Dockerfile.base.ubuntu-${{ matrix.release }}; sed -i.bak 's/FROM.*/FROM ubuntu:${{ matrix.release }}/' Dockerfile.base.ubuntu-${{ matrix.release }}
- name: Install Goss and dgoss
run: |
curl -fsSL https://goss.rocks/install | sh
export PATH=$PATH:/usr/local/bin
- name: Get current Git SHA
id: vars
run: echo "GIT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: set testable image environment variable
id: testvars
run: echo "GH_RUNNER_IMAGE=ubuntu-${{ matrix.release }}-${{ env.GIT_SHA }}-${{ matrix.platform }}" >> $GITHUB_ENV
- name: Login to DockerHub
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Retry build and load
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
with:
timeout_minutes: 60
max_attempts: 3
command: |
docker buildx build \
--file Dockerfile \
--platform linux/${{ matrix.platform }} \
--tag ${{ env.GH_RUNNER_IMAGE }} \
--load \
--pull \
--cache-from type=gha \
--cache-to type=gha,mode=max \
.
- name: Run goss tests
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
with:
timeout_minutes: 60
max_attempts: 3
command: |
echo "os: ubuntu" >goss_vars_${GH_RUNNER_IMAGE}.yaml
echo "oscodename: ${{ matrix.release }}" >>goss_vars_${GH_RUNNER_IMAGE}.yaml
echo "arch: ${{ matrix.platform }}" >>goss_vars_${GH_RUNNER_IMAGE}.yaml
GOSS_VARS=goss_vars_${GH_RUNNER_IMAGE}.yaml GOSS_FILE=goss_base.yaml GOSS_SLEEP=1 dgoss run --entrypoint /usr/bin/sleep -e RUNNER_NAME=test -e DEBUG_ONLY=true ${GH_RUNNER_IMAGE} 10
if [ $? -ne 0 ]; then
exit 1
fi
debian_base_tests:
runs-on: ubuntu-latest
strategy:
matrix:
release: [bookworm, sid]
platform: [amd64, arm64]
fail-fast: false
steps:
- name: Copy Repo Files
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Get GitHub organization or user
run: echo 'ORG='$(echo $(dirname ${GITHUB_REPOSITORY}) | awk '{print tolower($0)}') >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
with:
image: tonistiigi/binfmt:qemu-v7.0.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
- name: Copy Dockerfile
run: cp Dockerfile.base Dockerfile.base.debian-${{ matrix.release }}; sed -i.bak 's/FROM.*/FROM debian:${{ matrix.release }}/' Dockerfile.base.debian-${{ matrix.release }}
- name: Install Goss and dgoss
run: |
curl -fsSL https://goss.rocks/install | sh
export PATH=$PATH:/usr/local/bin
- name: Get current Git SHA
id: vars
run: echo "GIT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: set testable image environment variable
id: testvars
run: echo "GH_RUNNER_IMAGE=debian-${{ matrix.release }}-${{ env.GIT_SHA }}-${{ matrix.platform }}" >> $GITHUB_ENV
- name: Login to DockerHub
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Retry build
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
with:
timeout_minutes: 60
max_attempts: 3
command: |
docker buildx build \
--file Dockerfile.base.debian-${{ matrix.release }} \
--platform linux/${{ matrix.platform }} \
--tag ${{ env.GH_RUNNER_IMAGE }} \
--load \
--pull \
--cache-from type=gha \
--cache-to type=gha,mode=max \
.
- name: Run goss tests
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
with:
timeout_minutes: 60
max_attempts: 3
command: |
echo "os: debian" >goss_vars_${GH_RUNNER_IMAGE}.yaml
echo "oscodename: ${{ matrix.release }}" >>goss_vars_${GH_RUNNER_IMAGE}.yaml
echo "arch: ${{ matrix.platform }}" >>goss_vars_${GH_RUNNER_IMAGE}.yaml
GOSS_VARS=goss_vars_${GH_RUNNER_IMAGE}.yaml GOSS_FILE=goss_base.yaml GOSS_SLEEP=1 dgoss run --entrypoint /usr/bin/sleep -e RUNNER_NAME=test -e DEBUG_ONLY=true ${GH_RUNNER_IMAGE} 10
if [ $? -ne 0 ]; then
exit 1
fi
ubuntu_base_latest_deploy:
runs-on: ubuntu-latest
needs: ubuntu_base_tests
steps:
- name: Copy Repo Files
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Get GitHub organization or user
run: echo 'ORG='$(echo $(dirname ${GITHUB_REPOSITORY}) | awk '{print tolower($0)}') >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
with:
image: tonistiigi/binfmt:qemu-v7.0.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
- name: Login to DockerHub
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Retry build and push
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
with:
timeout_minutes: 60
max_attempts: 3
command: |
docker buildx build \
--file Dockerfile.base \
--platform linux/amd64,linux/arm64 \
--tag ${{ env.ORG }}/github-runner-base:latest \
--push \
--pull \
--cache-from type=gha \
--cache-to type=gha,mode=max \
.
ubuntu_base_deploy:
runs-on: ubuntu-latest
needs: ubuntu_base_tests
strategy:
matrix:
release: [jammy, focal, noble]
fail-fast: false
steps:
- name: Copy Repo Files
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Get GitHub organization or user
run: echo 'ORG='$(echo $(dirname ${GITHUB_REPOSITORY}) | awk '{print tolower($0)}') >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
with:
image: tonistiigi/binfmt:qemu-v7.0.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
- name: Copy Dockerfile
run: cp Dockerfile.base Dockerfile.base.ubuntu-${{ matrix.release }}; sed -i.bak 's/FROM.*/FROM ubuntu:${{ matrix.release }}/' Dockerfile.base.ubuntu-${{ matrix.release }}
- name: Login to DockerHub
uses: docker/login-action@v1
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
- name: Retry build and push
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
with:
context: .
file: Dockerfile.base.ubuntu-${{ matrix.release }}
pull: true
push: true
tags: ${{ env.ORG }}/github-runner-base:ubuntu-${{ matrix.release }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
timeout_minutes: 60
max_attempts: 3
command: |
docker buildx build \
--file Dockerfile.base.ubuntu-${{ matrix.release }} \
--platform linux/amd64,linux/arm64 \
--tag ${{ env.ORG }}/github-runner-base:ubuntu-${{ matrix.release }} \
--push \
--pull \
--cache-from type=gha \
--cache-to type=gha,mode=max \
.
debian_base_deploy:
runs-on: ubuntu-latest
needs: debian_base_tests
strategy:
matrix:
release: [bullseye, sid]
release: [bookworm, sid]
fail-fast: false
steps:
- name: Copy Repo Files
uses: actions/checkout@master
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Get GitHub organization or user
run: echo 'ORG='$(echo $(dirname ${GITHUB_REPOSITORY}) | awk '{print tolower($0)}') >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
with:
image: tonistiigi/binfmt:qemu-v7.0.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
- name: Copy Dockerfile
run: cp Dockerfile.base Dockerfile.base.debian-${{ matrix.release }}; sed -i.bak 's/FROM.*/FROM debian:${{ matrix.release }}/' Dockerfile.base.debian-${{ matrix.release }}
- name: Login to DockerHub
uses: docker/login-action@v1
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
- name: Retry build and push
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
with:
context: .
file: Dockerfile.base.debian-${{ matrix.release }}
pull: true
push: true
tags: ${{ env.ORG }}/github-runner-base:debian-${{ matrix.release }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
timeout_minutes: 60
max_attempts: 3
command: |
docker buildx build \
--file Dockerfile.base.debian-${{ matrix.release }} \
--platform linux/amd64,linux/arm64 \
--tag ${{ env.ORG }}/github-runner-base:debian-${{ matrix.release }} \
--push \
--pull \
--cache-from type=gha \
--cache-to type=gha,mode=max \
.
+30
View File
@@ -0,0 +1,30 @@
name: CodeQL Security Analysis
on:
push:
branches: [master]
jobs:
analyze:
name: Analyze GitHub Actions YAML
runs-on: ubuntu-latest
permissions:
security-events: write
actions: read
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Initialize CodeQL
uses: github/codeql-action/init@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
with:
languages: "actions"
queries: security-extended
config-file: .github/codeql/codeql-config.yml
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
with:
category: "/language:actions"
+289 -50
View File
@@ -10,123 +10,362 @@ on:
schedule:
- cron: '59 23 * * *'
permissions:
permissions:
contents: read
packages: write
packages: write
jobs:
ubuntu_latest_deploy:
ubuntu_tests:
runs-on: ubuntu-latest
strategy:
matrix:
release: [jammy, focal, noble]
platform: [amd64, arm64]
fail-fast: false
steps:
- name: Copy Repo Files
uses: actions/checkout@master
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Get GitHub organization or user
run: echo 'ORG='$(echo $(dirname ${GITHUB_REPOSITORY}) | awk '{print tolower($0)}') >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
with:
image: tonistiigi/binfmt:qemu-v7.0.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
- name: Copy Dockerfile
run: cp Dockerfile Dockerfile.ubuntu-${{ matrix.release }}; sed -i.bak "s/FROM.*/FROM ${ORG}\/github-runner-base:ubuntu-${{ matrix.release }}/" Dockerfile.ubuntu-${{ matrix.release }}
- name: Install Goss and dgoss
run: |
curl -fsSL https://goss.rocks/install | sh
export PATH=$PATH:/usr/local/bin
- name: Get current Git SHA
id: vars
run: echo "GIT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: set testable image environment variable
id: testvars
run: echo "GH_RUNNER_IMAGE=ubuntu-${{ matrix.release }}-${{ env.GIT_SHA }}-${{ matrix.platform }}" >> $GITHUB_ENV
- name: Login to DockerHub
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Retry build and load
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
with:
timeout_minutes: 60
max_attempts: 3
command: |
docker buildx build \
--file Dockerfile.ubuntu-${{ matrix.release }} \
--platform linux/${{ matrix.platform }} \
--tag ${{ env.GH_RUNNER_IMAGE }} \
--load \
--pull \
--cache-from type=gha \
--cache-to type=gha,mode=max \
.
# Tests will run against the final `${GH_RUNNER_IMAGE}` laid on top of `base-${GH_RUNNER_IMAGE}`
- name: Run goss tests
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
with:
timeout_minutes: 60
max_attempts: 3
command: |
echo "os: ubuntu" >goss_vars_${GH_RUNNER_IMAGE}.yaml
echo "oscodename: ${{ matrix.release }}" >>goss_vars_${GH_RUNNER_IMAGE}.yaml
echo "arch: ${{ matrix.platform }}" >>goss_vars_${GH_RUNNER_IMAGE}.yaml
# test the edge case from deregistration on reusable runners
GOSS_VARS=goss_vars_${GH_RUNNER_IMAGE}.yaml GOSS_FILE=goss_reusage_fail.yaml GOSS_SLEEP=1 dgoss run --entrypoint /usr/bin/sleep \
-e DEBUG_ONLY=true \
-e ACCESS_TOKEN=notreal \
-e LABELS=linux,x64 \
-e REPO_URL=https://github.com/octokode/test1 \
-e RUNNER_NAME=sustainjane-runner-1 \
-e RUNNER_SCOPE=repo \
-e RUNNER_WORKDIR=/tmp/runner/work \
-e DISABLE_AUTOMATIC_DEREGISTRATION=false \
-e CONFIGURED_ACTIONS_RUNNER_FILES_DIR=/runner/data \
${GH_RUNNER_IMAGE} 10
if [ $? -ne 0 ]; then
exit 1
fi
# test the base
GOSS_VARS=goss_vars_${GH_RUNNER_IMAGE}.yaml GOSS_FILE=goss_base.yaml GOSS_SLEEP=1 dgoss run --entrypoint /usr/bin/sleep -e RUNNER_NAME=test -e DEBUG_ONLY=true ${GH_RUNNER_IMAGE} 10
if [ $? -ne 0 ]; then
exit 1
fi
# test the final image but with all defaults
GOSS_VARS=goss_vars_${GH_RUNNER_IMAGE}.yaml GOSS_FILE=goss_full_defaults.yaml GOSS_SLEEP=1 dgoss run --entrypoint /usr/bin/sleep -e RUNNER_NAME=test -e DEBUG_ONLY=true ${GH_RUNNER_IMAGE} 10
if [ $? -ne 0 ]; then
exit 1
fi
# test the final image but with non-default values
GOSS_VARS=goss_vars_${GH_RUNNER_IMAGE}.yaml GOSS_FILE=goss_full.yaml GOSS_SLEEP=1 dgoss run --entrypoint /usr/bin/sleep \
-e DEBUG_ONLY=true \
-e RUNNER_NAME=huzzah \
-e REPO_URL=https://github.com/myoung34/docker-github-actions-runner \
-e RUN_AS_ROOT=true \
-e RUNNER_NAME_PREFIX=asdf \
-e ACCESS_TOKEN=1234 \
-e APP_ID=5678 \
-e APP_PRIVATE_KEY=2345 \
-e APP_LOGIN=SOMETHING \
-e RUNNER_SCOPE=org \
-e ORG_NAME=myoung34 \
-e ENTERPRISE_NAME=emyoung34 \
-e LABELS=blue,green \
-e RUNNER_TOKEN=3456 \
-e RUNNER_WORKDIR=/tmp/a \
-e RUNNER_GROUP=wat \
-e GITHUB_HOST=github.example.com \
-e DISABLE_AUTOMATIC_DEREGISTRATION=true \
-e EPHEMERAL=true \
-e DISABLE_AUTO_UPDATE=true \
${GH_RUNNER_IMAGE} 10
if [ $? -ne 0 ]; then
exit 1
fi
debian_tests:
runs-on: ubuntu-latest
strategy:
matrix:
release: [bookworm, sid]
platform: [amd64, arm64]
fail-fast: false
steps:
- name: Copy Repo Files
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Get GitHub organization or user
run: echo 'ORG='$(echo $(dirname ${GITHUB_REPOSITORY}) | awk '{print tolower($0)}') >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
with:
image: tonistiigi/binfmt:qemu-v7.0.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
- name: Copy Dockerfile
run: cp Dockerfile Dockerfile.debian-${{ matrix.release }}; sed -i.bak "s/FROM.*/FROM ${ORG}\/github-runner-base:debian-${{ matrix.release }}/" Dockerfile.debian-${{ matrix.release }}
- name: Install Goss and dgoss
run: |
curl -fsSL https://goss.rocks/install | sh
export PATH=$PATH:/usr/local/bin
- name: Get current Git SHA
id: vars
run: echo "GIT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: set testable image environment variable
id: testvars
run: echo "GH_RUNNER_IMAGE=debian-${{ matrix.release }}-${{ env.GIT_SHA }}-${{ matrix.platform }}" >> $GITHUB_ENV
- name: Login to DockerHub
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Retry build and load
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
with:
timeout_minutes: 60
max_attempts: 3
command: |
docker buildx build \
--file Dockerfile.debian-${{ matrix.release }} \
--platform linux/${{ matrix.platform }} \
--tag ${{ env.GH_RUNNER_IMAGE }} \
--load \
--pull \
--cache-from type=gha \
--cache-to type=gha,mode=max \
.
# Tests will run against the final `${GH_RUNNER_IMAGE}` laid on top of `base-${GH_RUNNER_IMAGE}`
- name: Run goss tests
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
with:
timeout_minutes: 60
max_attempts: 3
command: |
echo "os: debian" >goss_vars_${GH_RUNNER_IMAGE}.yaml
echo "oscodename: ${{ matrix.release }}" >>goss_vars_${GH_RUNNER_IMAGE}.yaml
echo "arch: ${{ matrix.platform }}" >>goss_vars_${GH_RUNNER_IMAGE}.yaml
# test the edge case from deregistration on reusable runners
GOSS_VARS=goss_vars_${GH_RUNNER_IMAGE}.yaml GOSS_FILE=goss_reusage_fail.yaml GOSS_SLEEP=1 dgoss run --entrypoint /usr/bin/sleep \
-e DEBUG_ONLY=true \
-e ACCESS_TOKEN=notreal \
-e LABELS=linux,x64 \
-e REPO_URL=https://github.com/octokode/test1 \
-e RUNNER_NAME=sustainjane-runner-1 \
-e RUNNER_SCOPE=repo \
-e RUNNER_WORKDIR=/tmp/runner/work \
-e DISABLE_AUTOMATIC_DEREGISTRATION=false \
-e CONFIGURED_ACTIONS_RUNNER_FILES_DIR=/runner/data \
${GH_RUNNER_IMAGE} 10
if [ $? -ne 0 ]; then
exit 1
fi
# test the base
GOSS_VARS=goss_vars_${GH_RUNNER_IMAGE}.yaml GOSS_FILE=goss_base.yaml GOSS_SLEEP=1 dgoss run --entrypoint /usr/bin/sleep -e RUNNER_NAME=test -e DEBUG_ONLY=true ${GH_RUNNER_IMAGE} 10
# test the final image but with all defaults
GOSS_VARS=goss_vars_${GH_RUNNER_IMAGE}.yaml GOSS_FILE=goss_full_defaults.yaml GOSS_SLEEP=1 dgoss run --entrypoint /usr/bin/sleep -e RUNNER_NAME=test -e DEBUG_ONLY=true ${GH_RUNNER_IMAGE} 10
# test the final image but with non-default values
GOSS_VARS=goss_vars_${GH_RUNNER_IMAGE}.yaml GOSS_FILE=goss_full.yaml GOSS_SLEEP=1 dgoss run --entrypoint /usr/bin/sleep \
-e DEBUG_ONLY=true \
-e RUNNER_NAME=huzzah \
-e REPO_URL=https://github.com/myoung34/docker-github-actions-runner \
-e RUN_AS_ROOT=true \
-e RUNNER_NAME_PREFIX=asdf \
-e ACCESS_TOKEN=1234 \
-e APP_ID=5678 \
-e APP_PRIVATE_KEY=2345 \
-e APP_LOGIN=SOMETHING \
-e RUNNER_SCOPE=org \
-e ORG_NAME=myoung34 \
-e ENTERPRISE_NAME=emyoung34 \
-e LABELS=blue,green \
-e RUNNER_TOKEN=3456 \
-e RUNNER_WORKDIR=/tmp/a \
-e RUNNER_GROUP=wat \
-e GITHUB_HOST=github.example.com \
-e DISABLE_AUTOMATIC_DEREGISTRATION=true \
-e EPHEMERAL=true \
-e DISABLE_AUTO_UPDATE=true \
${GH_RUNNER_IMAGE} 10
ubuntu_latest_deploy:
runs-on: ubuntu-latest
needs: ubuntu_tests
steps:
- name: Copy Repo Files
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Get GitHub organization or user
run: echo 'ORG='$(echo $(dirname ${GITHUB_REPOSITORY}) | awk '{print tolower($0)}') >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
with:
image: tonistiigi/binfmt:qemu-v7.0.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
- name: Update Dockerfile FROM org
run: sed -i.bak "s/FROM.*/FROM ${ORG}\/github-runner-base:latest/" Dockerfile
- name: Login to DockerHub
uses: docker/login-action@v2
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
- name: Retry build and push
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
with:
context: .
file: Dockerfile
pull: true
push: true
tags: ${{ env.ORG }}/github-runner:latest,ghcr.io/${{ github.repository }}:latest
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
timeout_minutes: 60
max_attempts: 3
command: |
docker buildx build \
--file Dockerfile \
--platform linux/amd64,linux/arm64 \
--tag ${{ env.ORG }}/github-runner:latest \
--tag ghcr.io/${{ github.repository }}:latest \
--push \
--pull \
--cache-from type=gha \
--cache-to type=gha,mode=max \
.
ubuntu_deploy:
runs-on: ubuntu-latest
needs: ubuntu_tests
strategy:
matrix:
release: [jammy, focal, bionic]
release: [jammy, focal, noble]
fail-fast: false
steps:
- name: Copy Repo Files
uses: actions/checkout@master
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Get GitHub organization or user
run: echo 'ORG='$(echo $(dirname ${GITHUB_REPOSITORY}) | awk '{print tolower($0)}') >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
with:
image: tonistiigi/binfmt:qemu-v7.0.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
- name: Copy Dockerfile
run: cp Dockerfile Dockerfile.ubuntu-${{ matrix.release }}; sed -i.bak "s/FROM.*/FROM ${ORG}\/github-runner-base:ubuntu-${{ matrix.release }}/" Dockerfile.ubuntu-${{ matrix.release }}
- name: Login to DockerHub
uses: docker/login-action@v2
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
- name: Retry build and push
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
with:
context: .
file: Dockerfile.ubuntu-${{ matrix.release }}
pull: true
push: true
tags: ${{env.ORG}}/github-runner:ubuntu-${{ matrix.release }},ghcr.io/${{ github.repository }}:ubuntu-${{ matrix.release }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
timeout_minutes: 60
max_attempts: 3
command: |
docker buildx build \
--file Dockerfile.ubuntu-${{ matrix.release }} \
--platform linux/amd64,linux/arm64 \
--tag ${{ env.ORG }}/github-runner:ubuntu-${{ matrix.release }} \
--tag ghcr.io/${{ github.repository }}:ubuntu-${{ matrix.release }} \
--push \
--pull \
--cache-from type=gha \
--cache-to type=gha,mode=max \
.
debian_deploy:
runs-on: ubuntu-latest
needs: debian_tests
strategy:
matrix:
release: [bullseye, sid]
release: [bookworm, sid]
fail-fast: false
steps:
- name: Copy Repo Files
uses: actions/checkout@master
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Get GitHub organization or user
run: echo 'ORG='$(echo $(dirname ${GITHUB_REPOSITORY}) | awk '{print tolower($0)}') >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
with:
image: tonistiigi/binfmt:qemu-v7.0.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
- name: Copy Dockerfile
run: cp Dockerfile Dockerfile.debian-${{ matrix.release }}; sed -i.bak "s/FROM.*/FROM ${ORG}\/github-runner-base:debian-${{ matrix.release }}/" Dockerfile.debian-${{ matrix.release }}
- name: Login to DockerHub
uses: docker/login-action@v2
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
- name: Retry build and push
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
with:
context: .
file: Dockerfile.debian-${{ matrix.release }}
pull: true
push: true
tags: ${{ env.ORG }}/github-runner:debian-${{ matrix.release }},ghcr.io/${{ github.repository }}:debian-${{ matrix.release }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
timeout_minutes: 60
max_attempts: 3
command: |
docker buildx build \
--file Dockerfile.debian-${{ matrix.release }} \
--platform linux/amd64,linux/arm64 \
--tag ${{ env.ORG }}/github-runner:debian-${{ matrix.release }} \
--tag ghcr.io/${{ github.repository }}:debian-${{ matrix.release }} \
--push \
--pull \
--cache-from type=gha \
--cache-to type=gha,mode=max \
.
+73 -53
View File
@@ -4,9 +4,9 @@ on:
tags:
- '*'
permissions:
contents: read
packages: write
permissions:
contents: write
packages: write
jobs:
create-release:
@@ -14,10 +14,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Create Release
id: create_release
uses: actions/create-release@v1
uses: actions/create-release@0cb9c9b65d5d1901c1f53e5e66eaf4afd303e70e # v1.1.4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
@@ -31,122 +31,142 @@ jobs:
needs: create-release
steps:
- name: Copy Repo Files
uses: actions/checkout@master
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: get version
run: echo 'TAG='${GITHUB_REF#refs/tags/} >> $GITHUB_ENV
- name: Get GitHub organization or user
run: echo 'ORG='$(echo $(dirname ${GITHUB_REPOSITORY}) | awk '{print tolower($0)}') >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
with:
image: tonistiigi/binfmt:qemu-v7.0.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
- name: Update Dockerfile FROM org
run: sed -i.bak "s/FROM.*/FROM ${ORG}\/github-runner-base:latest/" Dockerfile
- name: Login to DockerHub
uses: docker/login-action@v2
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
- name: Retry build and push
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
with:
context: .
file: Dockerfile
pull: true
push: true
tags: ${{ env.ORG }}/github-runner:${{ env.TAG }},ghcr.io/${{ github.repository }}:${{ env.TAG }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
timeout_minutes: 60
max_attempts: 3
command: |
docker buildx build \
--file Dockerfile \
--platform linux/amd64,linux/arm64 \
--tag ${{ env.ORG }}/github-runner:${{ env.TAG }} \
--tag ghcr.io/${{ github.repository }}:${{ env.TAG }} \
--push \
--pull \
--cache-from type=gha \
--cache-to type=gha,mode=max \
.
ubuntu_tag:
runs-on: ubuntu-latest
needs: create-release
strategy:
matrix:
release: [jammy, focal, bionic]
release: [jammy, focal, noble]
fail-fast: false
steps:
- name: Copy Repo Files
uses: actions/checkout@master
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: get version
run: echo 'TAG='${GITHUB_REF#refs/tags/} >> $GITHUB_ENV
- name: Get GitHub organization or user
run: echo 'ORG='$(echo $(dirname ${GITHUB_REPOSITORY}) | awk '{print tolower($0)}') >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
with:
image: tonistiigi/binfmt:qemu-v7.0.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
- name: Copy Dockerfile
run: cp Dockerfile Dockerfile.ubuntu-${{ matrix.release }}; sed -i.bak "s/FROM.*/FROM ${ORG}\/github-runner-base:ubuntu-${{ matrix.release }}/" Dockerfile.ubuntu-${{ matrix.release }}
- name: Login to DockerHub
uses: docker/login-action@v2
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
- name: Retry build and push
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
with:
context: .
file: Dockerfile.ubuntu-${{ matrix.release }}
pull: true
push: true
tags: ${{ env.ORG }}/github-runner:${{ env.TAG }}-ubuntu-${{ matrix.release }},ghcr.io/${{ github.repository }}:${{ env.TAG }}-ubuntu-${{ matrix.release }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
timeout_minutes: 60
max_attempts: 3
command: |
docker buildx build \
--file Dockerfile.ubuntu-${{ matrix.release }} \
--platform linux/amd64,linux/arm64 \
--tag ${{ env.ORG }}/github-runner:${{ env.TAG }}-ubuntu-${{ matrix.release }} \
--tag ghcr.io/${{ github.repository }}:${{ env.TAG }}-ubuntu-${{ matrix.release }} \
--push \
--pull \
--cache-from type=gha \
--cache-to type=gha,mode=max \
.
debian_tag:
runs-on: ubuntu-latest
strategy:
matrix:
release: [bullseye, sid]
release: [bookworm, sid]
fail-fast: false
needs: create-release
steps:
- name: Copy Repo Files
uses: actions/checkout@master
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: get version
run: echo 'TAG='${GITHUB_REF#refs/tags/} >> $GITHUB_ENV
- name: Get GitHub organization or user
run: echo 'ORG='$(echo $(dirname ${GITHUB_REPOSITORY}) | awk '{print tolower($0)}') >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
with:
image: tonistiigi/binfmt:qemu-v7.0.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
- name: Copy Dockerfile
run: cp Dockerfile Dockerfile.debian-${{ matrix.release }}; sed -i.bak "s/FROM.*/FROM ${ORG}\/github-runner-base:debian-${{ matrix.release }}/" Dockerfile.debian-${{ matrix.release }}
- name: Login to DockerHub
uses: docker/login-action@v2
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
- name: Retry build and push
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
with:
context: .
file: Dockerfile.debian-${{ matrix.release }}
pull: true
push: true
tags: ${{ env.ORG }}/github-runner:${{ env.TAG }}-debian-${{ matrix.release }},ghcr.io/${{ github.repository }}:${{ env.TAG }}-debian-${{ matrix.release }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
timeout_minutes: 60
max_attempts: 3
command: |
docker buildx build \
--file Dockerfile.debian-${{ matrix.release }} \
--platform linux/amd64,linux/arm64 \
--tag ${{ env.ORG }}/github-runner:${{ env.TAG }}-debian-${{ matrix.release }} \
--tag ghcr.io/${{ github.repository }}:${{ env.TAG }}-debian-${{ matrix.release }} \
--push \
--pull \
--cache-from type=gha \
--cache-to type=gha,mode=max \
.
+23
View File
@@ -0,0 +1,23 @@
name: 'Close stale issues and PR'
on:
schedule:
- cron: '30 1 * * *'
permissions:
issues: write
pull-requests: write
jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 # v9.1.0
with:
stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.'
stale-pr-message: 'This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.'
close-issue-message: 'This issue was closed because it has been stalled for 5 days with no activity.'
days-before-stale: 30
days-before-close: 5
days-before-pr-close: -1
exempt-issue-labels: 'stale-exempt'
exempt-pr-labels: 'stale-exempt'
+225 -5
View File
@@ -5,11 +5,231 @@ name: "Trigger: Push action"
jobs:
tests:
name: Tests
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v3
- uses: pre-commit/action@v3.0.0
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
uses: ludeeus/action-shellcheck@00b27aa7cb85167568cb48a3838b75f4265f2bca # master
ubuntu_tests:
runs-on: ubuntu-latest
strategy:
matrix:
release: [jammy, focal, noble]
platform: [amd64, arm64]
fail-fast: false
steps:
- name: Copy Repo Files
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Get GitHub organization or user
run: echo 'ORG='$(echo $(dirname ${GITHUB_REPOSITORY}) | awk '{print tolower($0)}') >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
with:
image: tonistiigi/binfmt:qemu-v7.0.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
- name: Install Goss and dgoss
run: |
curl -fsSL https://goss.rocks/install | sh
export PATH=$PATH:/usr/local/bin
- name: Get current Git SHA
id: vars
run: echo "GIT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: set testable image environment variable
id: testvars
run: echo "GH_RUNNER_IMAGE=ubuntu-${{ matrix.release }}-${{ env.GIT_SHA }}-${{ matrix.platform }}" >> $GITHUB_ENV
- name: Combine Dockerfile
run: |
cp Dockerfile.base Dockerfile.final.ubuntu-${{ matrix.release }};
sed -i.bak 's/FROM.*/FROM ubuntu:${{ matrix.release }}/' Dockerfile.final.ubuntu-${{ matrix.release }}
# Combine the dockerfiles
cp Dockerfile Dockerfile.ubuntu-${{ matrix.release }}
cat Dockerfile.ubuntu-${{ matrix.release }} | sed "s/^FROM.*//" >>Dockerfile.final.ubuntu-${{ matrix.release }}
# Sanity check
grep FROM Dockerfile.final.ubuntu-${{ matrix.release }}
- name: Retry build final image
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
with:
timeout_minutes: 60
max_attempts: 3
command: |
docker buildx build \
--file Dockerfile.final.ubuntu-${{ matrix.release }} \
--platform linux/${{ matrix.platform }} \
--tag ${{ env.GH_RUNNER_IMAGE }} \
--load \
--cache-from type=gha \
--cache-to type=gha,mode=max \
.
# Tests will run against the final `${GH_RUNNER_IMAGE}` laid on top of `base-${GH_RUNNER_IMAGE}`
- name: Run goss tests
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
with:
timeout_minutes: 60
max_attempts: 3
command: |
echo "os: ubuntu" >goss_vars_${GH_RUNNER_IMAGE}.yaml
echo "oscodename: ${{ matrix.release }}" >>goss_vars_${GH_RUNNER_IMAGE}.yaml
echo "arch: ${{ matrix.platform }}" >>goss_vars_${GH_RUNNER_IMAGE}.yaml
# test the edge case from deregistration on reusable runners
GOSS_VARS=goss_vars_${GH_RUNNER_IMAGE}.yaml GOSS_FILE=goss_reusage_fail.yaml GOSS_SLEEP=1 dgoss run --entrypoint /usr/bin/sleep \
-e DEBUG_ONLY=true \
-e ACCESS_TOKEN=notreal \
-e LABELS=linux,x64 \
-e REPO_URL=https://github.com/octokode/test1 \
-e RUNNER_NAME=sustainjane-runner-1 \
-e RUNNER_SCOPE=repo \
-e RUNNER_WORKDIR=/tmp/runner/work \
-e DISABLE_AUTOMATIC_DEREGISTRATION=false \
-e CONFIGURED_ACTIONS_RUNNER_FILES_DIR=/runner/data \
${GH_RUNNER_IMAGE} 10
if [ $? -ne 0 ]; then
exit 1
fi
# test the base
GOSS_VARS=goss_vars_${GH_RUNNER_IMAGE}.yaml GOSS_FILE=goss_base.yaml GOSS_SLEEP=1 dgoss run --entrypoint /usr/bin/sleep -e RUNNER_NAME=test -e DEBUG_ONLY=true ${GH_RUNNER_IMAGE} 10
if [ $? -ne 0 ]; then
exit 1
fi
# test the final image but with all defaults
GOSS_VARS=goss_vars_${GH_RUNNER_IMAGE}.yaml GOSS_FILE=goss_full_defaults.yaml GOSS_SLEEP=1 dgoss run --entrypoint /usr/bin/sleep -e RUNNER_NAME=test -e DEBUG_ONLY=true ${GH_RUNNER_IMAGE} 10
if [ $? -ne 0 ]; then
exit 1
fi
# test the final image but with non-default values
GOSS_VARS=goss_vars_${GH_RUNNER_IMAGE}.yaml GOSS_FILE=goss_full.yaml GOSS_SLEEP=1 dgoss run --entrypoint /usr/bin/sleep \
-e DEBUG_ONLY=true \
-e RUNNER_NAME=huzzah \
-e REPO_URL=https://github.com/myoung34/docker-github-actions-runner \
-e RUN_AS_ROOT=true \
-e RUNNER_NAME_PREFIX=asdf \
-e ACCESS_TOKEN=1234 \
-e APP_ID=5678 \
-e APP_PRIVATE_KEY=2345 \
-e APP_LOGIN=SOMETHING \
-e RUNNER_SCOPE=org \
-e ORG_NAME=myoung34 \
-e ENTERPRISE_NAME=emyoung34 \
-e LABELS=blue,green \
-e RUNNER_TOKEN=3456 \
-e RUNNER_WORKDIR=/tmp/a \
-e RUNNER_GROUP=wat \
-e GITHUB_HOST=github.example.com \
-e DISABLE_AUTOMATIC_DEREGISTRATION=true \
-e EPHEMERAL=true \
-e DISABLE_AUTO_UPDATE=true \
${GH_RUNNER_IMAGE} 10
if [ $? -ne 0 ]; then
exit 1
fi
debian_tests:
runs-on: ubuntu-latest
strategy:
matrix:
release: [bookworm, sid]
platform: [amd64, arm64]
fail-fast: false
steps:
- name: Copy Repo Files
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Get GitHub organization or user
run: echo 'ORG='$(echo $(dirname ${GITHUB_REPOSITORY}) | awk '{print tolower($0)}') >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
with:
image: tonistiigi/binfmt:qemu-v7.0.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
- name: Install Goss and dgoss
run: |
curl -fsSL https://goss.rocks/install | sh
export PATH=$PATH:/usr/local/bin
- name: Get current Git SHA
id: vars
run: echo "GIT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: set testable image environment variable
id: testvars
run: echo "GH_RUNNER_IMAGE=debian-${{ matrix.release }}-${{ env.GIT_SHA }}-${{ matrix.platform }}" >> $GITHUB_ENV
- name: Combine Dockerfile
run: |
cp Dockerfile.base Dockerfile.final.debian-${{ matrix.release }}
sed -i.bak 's/FROM.*/FROM debian:${{ matrix.release }}/' Dockerfile.final.debian-${{ matrix.release }}
# Combine the dockerfiles
cp Dockerfile Dockerfile.debian-${{ matrix.release }}
cat Dockerfile.debian-${{ matrix.release }} | sed "s/^FROM.*//" >>Dockerfile.final.debian-${{ matrix.release }}
# Sanity check
grep FROM Dockerfile.final.debian-${{ matrix.release }}
- name: Retry build final image
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
with:
timeout_minutes: 60
max_attempts: 3
command: |
docker buildx build \
--file Dockerfile.final.debian-${{ matrix.release }} \
--platform linux/${{ matrix.platform }} \
--tag ${{ env.GH_RUNNER_IMAGE }} \
--load \
--cache-from type=gha \
--cache-to type=gha,mode=max \
.
# Tests will run against the final `${GH_RUNNER_IMAGE}` laid on top of `base-${GH_RUNNER_IMAGE}`
- name: Run goss tests
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
with:
timeout_minutes: 60
max_attempts: 3
command: |
echo "os: debian" >goss_vars_${GH_RUNNER_IMAGE}.yaml
echo "oscodename: ${{ matrix.release }}" >>goss_vars_${GH_RUNNER_IMAGE}.yaml
echo "arch: ${{ matrix.platform }}" >>goss_vars_${GH_RUNNER_IMAGE}.yaml
# test the edge case from deregistration on reusable runners
GOSS_VARS=goss_vars_${GH_RUNNER_IMAGE}.yaml GOSS_FILE=goss_reusage_fail.yaml GOSS_SLEEP=1 dgoss run --entrypoint /usr/bin/sleep \
-e DEBUG_ONLY=true \
-e ACCESS_TOKEN=notreal \
-e LABELS=linux,x64 \
-e REPO_URL=https://github.com/octokode/test1 \
-e RUNNER_NAME=sustainjane-runner-1 \
-e RUNNER_SCOPE=repo \
-e RUNNER_WORKDIR=/tmp/runner/work \
-e DISABLE_AUTOMATIC_DEREGISTRATION=false \
-e CONFIGURED_ACTIONS_RUNNER_FILES_DIR=/runner/data \
${GH_RUNNER_IMAGE} 10
if [ $? -ne 0 ]; then
exit 1
fi
# test the base
GOSS_VARS=goss_vars_${GH_RUNNER_IMAGE}.yaml GOSS_FILE=goss_base.yaml GOSS_SLEEP=1 dgoss run --entrypoint /usr/bin/sleep -e RUNNER_NAME=test -e DEBUG_ONLY=true ${GH_RUNNER_IMAGE} 10
# test the final image but with all defaults
GOSS_VARS=goss_vars_${GH_RUNNER_IMAGE}.yaml GOSS_FILE=goss_full_defaults.yaml GOSS_SLEEP=1 dgoss run --entrypoint /usr/bin/sleep -e RUNNER_NAME=test -e DEBUG_ONLY=true ${GH_RUNNER_IMAGE} 10
# test the final image but with non-default values
GOSS_VARS=goss_vars_${GH_RUNNER_IMAGE}.yaml GOSS_FILE=goss_full.yaml GOSS_SLEEP=1 dgoss run --entrypoint /usr/bin/sleep \
-e DEBUG_ONLY=true \
-e RUNNER_NAME=huzzah \
-e REPO_URL=https://github.com/myoung34/docker-github-actions-runner \
-e RUN_AS_ROOT=true \
-e RUNNER_NAME_PREFIX=asdf \
-e ACCESS_TOKEN=1234 \
-e APP_ID=5678 \
-e APP_PRIVATE_KEY=2345 \
-e APP_LOGIN=SOMETHING \
-e RUNNER_SCOPE=org \
-e ORG_NAME=myoung34 \
-e ENTERPRISE_NAME=emyoung34 \
-e LABELS=blue,green \
-e RUNNER_TOKEN=3456 \
-e RUNNER_WORKDIR=/tmp/a \
-e RUNNER_GROUP=wat \
-e GITHUB_HOST=github.example.com \
-e DISABLE_AUTOMATIC_DEREGISTRATION=true \
-e EPHEMERAL=true \
-e DISABLE_AUTO_UPDATE=true \
${GH_RUNNER_IMAGE} 10
+1
View File
@@ -1 +1,2 @@
*.bak
.idea
+1 -4
View File
@@ -3,12 +3,9 @@ repos:
rev: v4.3.0
hooks:
- id: check-yaml
exclude: goss_[a-z]*.yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-case-conflict
- id: check-merge-conflict
- id: detect-private-key
- repo: https://github.com/stratasan/hadolint-pre-commit
rev: cdefcb096e520a6daa9552b1d4636f5f1e1729cd
hooks:
- id: hadolint
+1 -1
View File
@@ -1 +1 @@
shellcheck 0.7.0
shellcheck 0.10.0
+20 -9
View File
@@ -1,17 +1,28 @@
# Welcome to docker-github-actions-runner contributing guide <!-- omit in toc -->
# Contributing to docker-github-actions-runner
Welcome!
Thank you for your interest in contributing to `docker-github-actions-runner`! This guide is designed to make your contribution experience smooth and effective. Let's work together to make this project even better!
## Code of conduct
## Table of Contents
- [Code of Conduct](#code-of-conduct)
- [Issues](#issues)
- [Before Creating an Issue](#before-creating-an-issue)
- [Contribute to the Wiki](#contribute-to-the-wiki)
Be kind, research before asking/contributing.
## Code of Conduct
Please remember that my time is limited and my resources are as well. Solving "nuances" will likely require external contributions but I'm happy to help and guide.
We aim to foster a welcoming and inclusive environment for all contributors. Here are some guidelines to keep in mind:
### Issues
- **Be Respectful**: Treat everyone with kindness and respect. Avoid making assumptions or passing judgments.
- **Do Your Research**: Before asking or contributing, take a moment to research. It's possible that your question or issue has already been addressed.
- **Value Everyone's Time**: Please understand that the maintainers and contributors have other commitments. While we're always eager to help, addressing certain nuances might require external contributions. However, we're here to guide and assist you.
#### Create a new issue
## Issues
If you spot an issue, [search if an issue already exists](https://docs.github.com/en/github/searching-for-information-on-github/searching-on-github/searching-issues-and-pull-requests#search-by-the-title-body-or-comments). If a related issue doesn't exist, you can open a new issue using a relevant issue.
### Before Creating an Issue
Also use [the wiki](https://github.com/myoung34/docker-github-actions-runner/wiki) and contribute to it
1. **Search Existing Issues**: Before creating a new issue, please [check if a similar issue already exists](https://github.com/myoung34/docker-github-actions-runner/issues). This helps in reducing duplicates and streamlining discussions.
2. **Refer to the Wiki**: The [project's wiki](https://github.com/myoung34/docker-github-actions-runner/wiki) is a valuable resource. It might have the information or solution you're seeking.
## Contribute to the Wiki
The [wiki](https://github.com/myoung34/docker-github-actions-runner/wiki) is a collaborative space for the community. You're encouraged to share knowledge, tips, and best practices related to `docker-github-actions-runner`. Your contributions can help others and enhance the overall quality of the wiki.
+4 -3
View File
@@ -5,7 +5,8 @@ LABEL maintainer="myoung34@my.apsu.edu"
ENV AGENT_TOOLSDIRECTORY=/opt/hostedtoolcache
RUN mkdir -p /opt/hostedtoolcache
ARG GH_RUNNER_VERSION="2.296.2"
ARG GH_RUNNER_VERSION="2.327.0"
ARG TARGETPLATFORM
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
@@ -18,8 +19,8 @@ RUN chmod +x /actions-runner/install_actions.sh \
&& rm /actions-runner/install_actions.sh \
&& chown runner /_work /actions-runner /opt/hostedtoolcache
COPY token.sh entrypoint.sh /
RUN chmod +x /token.sh /entrypoint.sh
COPY token.sh entrypoint.sh app_token.sh /
RUN chmod +x /token.sh /entrypoint.sh /app_token.sh
ENTRYPOINT ["/entrypoint.sh"]
CMD ["./bin/Runner.Listener", "run", "--startuptype", "service"]
+5 -70
View File
@@ -2,79 +2,14 @@ FROM ubuntu:focal
LABEL maintainer="myoung34@my.apsu.edu"
ARG DUMB_INIT_VERSION="1.2.2"
ARG GIT_CORE_PPA_KEY="A1715D88E1DF1F24"
ENV DOCKER_COMPOSE_VERSION="1.27.4"
# TODO: remove git PPA and skopeo customizations for focal when focal hits EOL
ENV GIT_LFS_VERSION="3.2.0"
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US.UTF-8
ENV LC_ALL=en_US.UTF-8
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
ENV DEBIAN_FRONTEND=noninteractive
# hadolint ignore=SC2086,DL3015,DL3008,DL3013
RUN echo en_US.UTF-8 UTF-8 >> /etc/locale.gen \
&& apt-get update \
&& apt-get install -y --no-install-recommends gnupg \
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys ${GIT_CORE_PPA_KEY} \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
gnupg \
lsb-release \
curl \
tar \
unzip \
apt-transport-https \
ca-certificates \
sudo \
gpg-agent \
software-properties-common \
build-essential \
zlib1g-dev \
zstd \
gettext \
libcurl4-openssl-dev \
inetutils-ping \
jq \
wget \
dirmngr \
openssh-client \
locales \
python3-pip \
python3-setuptools \
python3 \
dumb-init \
nodejs \
rsync \
gosu \
&& DPKG_ARCH="$(dpkg --print-architecture)" \
&& LSB_RELEASE_CODENAME="$(lsb_release --codename | cut -f2)" \
&& sed -e 's/Defaults.*env_reset/Defaults env_keep = "HTTP_PROXY HTTPS_PROXY NO_PROXY FTP_PROXY http_proxy https_proxy no_proxy ftp_proxy"/' -i /etc/sudoers \
&& echo deb http://ppa.launchpad.net/git-core/ppa/ubuntu $([[ $(grep -E '^ID=' /etc/os-release | sed 's/.*=//g') == "ubuntu" ]] && (grep VERSION_CODENAME /etc/os-release | sed 's/.*=//g') || echo bionic) main>/etc/apt/sources.list.d/git-core.list \
&& apt-get update \
&& ( apt-get install -y --no-install-recommends git || apt-get install -t stable -y --no-install-recommends git || apt-get install -y --no-install-recommends git=1:2.33.1-0ppa1~ubuntu18.04.1 git-man=1:2.33.1-0ppa1~ubuntu18.04.1 ) \
&& ( [[ $(apt-cache search -n liblttng-ust0 | awk '{print $1}') == "liblttng-ust0" ]] && apt-get install -y --no-install-recommends liblttng-ust0 || : ) \
&& ( [[ $(apt-cache search -n liblttng-ust1 | awk '{print $1}') == "liblttng-ust1" ]] && apt-get install -y --no-install-recommends liblttng-ust1 || : ) \
&& ( ( curl "https://awscli.amazonaws.com/awscli-exe-linux-$(uname -m).zip" -o "awscliv2.zip" && unzip awscliv2.zip -d /tmp/ && /tmp/aws/install && rm awscliv2.zip) || pip3 install --no-cache-dir awscli ) \
&& ( curl -s "https://github.com/git-lfs/git-lfs/releases/download/v${GIT_LFS_VERSION}/git-lfs-linux-${DPKG_ARCH}-v${GIT_LFS_VERSION}.tar.gz" -L -o /tmp/lfs.tar.gz && tar -xzf /tmp/lfs.tar.gz -C /tmp && /tmp/git-lfs-${GIT_LFS_VERSION}/install.sh && rm -rf /tmp/lfs.tar.gz /tmp/git-lfs-${GIT_LFS_VERSION}) \
# Determine the Distro name (Debian, Ubuntu, etc)
&& distro=$(lsb_release -is | awk '{print tolower($0)}') \
# Determine the Distro version (bullseye, xenial, etc)
# Note: sid is aliased to bullseye, because Docker doesn't have a matching apt repo
&& mkdir -p /etc/apt/keyrings \
&& ( curl -fsSL https://download.docker.com/linux/${distro}/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg ) \
&& version=$(lsb_release -cs | awk '{gsub("sid", "bullseye"); print $0}') \
&& ( echo "deb [arch=${DPKG_ARCH} signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/${distro} ${version} stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null ) \
&& apt-get update \
&& apt-get install -y docker-ce docker-ce-cli containerd.io --no-install-recommends --allow-unauthenticated \
&& ( [[ $(lscpu -J | jq -r '.lscpu[] | select(.field == "Vendor ID:") | .data') == "ARM" ]] && echo "Not installing docker-compose. See https://github.com/docker/compose/issues/6831" || ( curl -sL "https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose && chmod +x /usr/local/bin/docker-compose ) ) \
&& ( [[ "${LSB_RELEASE_CODENAME}" == "focal" ]] && ( echo "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_20.04/ /" | tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list && curl -L "https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_20.04/Release.key" | apt-key add - && apt-get update) || : ) \
&& ( [[ "${LSB_RELEASE_CODENAME}" == "focal" || "${LSB_RELEASE_CODENAME}" == "jammy" || "${LSB_RELEASE_CODENAME}" == "sid" || "${LSB_RELEASE_CODENAME}" == "bullseye" ]] && apt-get install -y --no-install-recommends podman buildah skopeo || : ) \
&& ( [[ "${LSB_RELEASE_CODENAME}" == "jammy" ]] && echo "Ubuntu Jammy is marked as beta. Please see https://github.com/actions/virtual-environments/issues/5490" || : ) \
&& GH_CLI_INSTALL_FILE="/tmp/gh-$$.deb" && curl -sSLo "${GH_CLI_INSTALL_FILE}" "https://github.com$(curl -sSL "https://github.com/cli/cli/releases/latest" | grep -Po "(?<=href=\")/cli/cli/releases/download/[^\"]*${DPKG_ARCH}[.]deb(?=\")")" && apt-get -y install "${GH_CLI_INSTALL_FILE}" \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /tmp/* \
&& groupadd -g 121 runner \
&& useradd -mr -d /home/runner -u 1001 -g 121 runner \
&& usermod -aG sudo runner \
&& usermod -aG docker runner \
&& echo '%sudo ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
COPY --chmod=700 build/ /tmp/build/
RUN /tmp/build/install_base.sh
+670 -17
View File
@@ -1,21 +1,674 @@
MIT License
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (c) 2020 Marcus Young
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
Preamble
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
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
SOFTWARE.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.
+66 -12
View File
@@ -10,11 +10,16 @@ This will run the [new self-hosted github actions runners](https://help.github.c
Please see [the wiki](https://github.com/myoung34/docker-github-actions-runner/wiki/Usage)
Please read [the contributing guidelines](https://github.com/myoung34/docker-github-actions-runner/blob/master/CONTRIBUTING.md)
## Included software and configuration ##
While this project is not perfectly 1:1 with the software upstream, the included packages etc are available [here](https://github.com/myoung34/docker-github-actions-runner/blob/master/build/config.json). Documentation can be found in [the wiki](https://github.com/myoung34/docker-github-actions-runner/wiki/Usage#modifications)
## Notes ##
### Security ###
It is known that currently tokens (ACCESS_TOKEN / RUNNER_TOKEN ) are not safe from exfiltration.
It is known that environment variables are not safe from exfiltration.
If you are using this runner make sure that any workflow changes are gated by a verification process (in the actions settings) so that malicious PR's cannot exfiltrate these.
### Docker Support ###
@@ -31,20 +36,15 @@ Also, some GitHub Actions Workflow features, like [Job Services](https://docs.gi
Currently runners [do not support containerd](https://github.com/actions/runner/issues/1265)
### Docker-Compose on ARM ###
Please note `docker-compose` does not currently work on ARM ([see issue](https://github.com/docker/compose/issues/6831)) so it is not installed on ARM based builds here.
A workaround exists, please see [here](https://github.com/myoung34/docker-github-actions-runner/issues/72#issuecomment-804723656)
## Docker Artifacts ##
| Container Base | Supported Architectures | Tag Regex | Docker Tags | Description | Notes |
| --- | --- | --- | --- | --- | --- |
| ubuntu focal | `x86_64`,`arm64` | `/\d\.\d{3}\.\d+/` `/\d\.\d{3}\.\d+-ubuntu-focal/`| [latest](https://hub.docker.com/r/myoung34/github-runner/tags?page=1&name=latest) [ubuntu-focal](https://hub.docker.com/r/myoung34/github-runner/tags?page=1&name=ubuntu-focal) | This is the latest build (Rebuilt nightly and on master merges). Tags without an OS name are included. Tags with `-ubuntu-focal` are included and created on [upstream tags](https://github.com/actions/runner/tags).|
| ubuntu noble | `x86_64`,`arm64` | `/\d\.\d{3}\.\d+-ubuntu-noble/` | [ubuntu-noble](https://hub.docker.com/r/myoung34/github-runner/tags?page=1&name=ubuntu-noble) | This is the latest build from noble (Rebuilt nightly and on master merges). Tags with `-ubuntu-noble` are included and created on [upstream tags](https://github.com/actions/runner/tags). | |
| ubuntu jammy | `x86_64`,`arm64` | `/\d\.\d{3}\.\d+-ubuntu-jammy/` | [ubuntu-jammy](https://hub.docker.com/r/myoung34/github-runner/tags?page=1&name=ubuntu-jammy) | This is the latest build from jammy (Rebuilt nightly and on master merges). Tags with `-ubuntu-jammy` are included and created on [upstream tags](https://github.com/actions/runner/tags). | There is [currently an issue with jammy from inside a 20.04LTS host](https://github.com/myoung34/docker-github-actions-runner/issues/219) which is why this is not `latest` |
| ubuntu bionic | `x86_64`,`arm64` | `/\d\.\d{3}\.\d+-ubuntu-bionic/` | [ubuntu-bionic](https://hub.docker.com/r/myoung34/github-runner/tags?page=1&name=ubuntu-bionic) | This is the latest build from bionic (Rebuilt nightly and on master merges). Tags with `-ubuntu-bionic` are included and created on [upstream tags](https://github.com/actions/runner/tags). | |
| debian buster (now deprecated) | `x86_64`,`arm64` | `/\d\.\d{3}\.\d+-debian-buster/` | [debian-buster](https://hub.docker.com/r/myoung34/github-runner/tags?page=1&name=debian-buster) | Debian buster is now deprecated. The packages for arm v7 are in flux and are wildly causing build failures (git as well as apt-key and liblttng-ust#. Tags with `-debian-buster` are included and created on [upstream tags](https://github.com/actions/runner/tags). | |
| debian bullseye | `x86_64`,`arm64` | `/\d\.\d{3}\.\d+-debian-bullseye/` | [debian-bullseye](https://hub.docker.com/r/myoung34/github-runner/tags?page=1&name=debian-bullseye) | This is the latest build from bullseye (Rebuilt nightly and on master merges). Tags with `-debian-bullseye` are included and created on [upstream tags](https://github.com/actions/runner/tags). | |
| debian buster (now deprecated) | `x86_64`,`arm64` | `/\d\.\d{3}\.\d+-debian-buster/` | [debian-buster](https://hub.docker.com/r/myoung34/github-runner/tags?page=1&name=debian-buster) | Debian buster is now deprecated. The packages for arm v7 are in flux and are wildly causing build failures (git as well as liblttng-ust#. Tags with `-debian-buster` are included and created on [upstream tags](https://github.com/actions/runner/tags). | |
| debian bookworm | `x86_64`,`arm64` | `/\d\.\d{3}\.\d+-debian-bookworm/` | [debian-bookworm](https://hub.docker.com/r/myoung34/github-runner/tags?page=1&name=debian-bookworm) | This is the latest build from bookworm (Rebuilt nightly and on master merges). Tags with `-debian-bookworm` are included and created on [upstream tags](https://github.com/actions/runner/tags). | |
| debian sid | `x86_64`,`arm64` | `/\d\.\d{3}\.\d+-debian-sid/` | [debian-sid](https://hub.docker.com/r/myoung34/github-runner/tags?page=1&name=debian-sid) | This is the latest build from sid (Rebuilt nightly and on master merges). Tags with `-debian-sid` are included and created on [upstream tags](https://github.com/actions/runner/tags). | |
These containers are built via Github actions that [copy the dockerfile](https://github.com/myoung34/docker-github-actions-runner/blob/master/.github/workflows/deploy.yml#L47), changing the `FROM` and building to provide simplicity.
@@ -54,10 +54,14 @@ These containers are built via Github actions that [copy the dockerfile](https:/
| Environment Variable | Description |
| --- | --- |
| `RUN_AS_ROOT` | Boolean to run as root. If `true`: will run as root. If `True` and the user is overridden it will error. If any other value it will run as the `runner` user and allow an optional override. Default is `true` |
| `RUNNER_NAME` | The name of the runner to use. Supercedes (overrides) `RUNNER_NAME_PREFIX` |
| `RUNNER_NAME_PREFIX` | A prefix for a randomly generated name (followed by a random 13 digit string). You must not also provide `RUNNER_NAME`. Defaults to `github-runner` |
| `RUNNER_NAME` | The name of the runner to use. Supersedes (overrides) `RUNNER_NAME_PREFIX` |
| `RUNNER_NAME_PREFIX` | A prefix for runner name (See `RANDOM_RUNNER_SUFFIX` for how the full name is generated). Note: will be overridden by `RUNNER_NAME` if provided. Defaults to `github-runner` |
| `RANDOM_RUNNER_SUFFIX` | Boolean to use a randomized runner name suffix (preceded by `RUNNER_NAME_PREFIX`). Will use a 13 character random string by default. If set to a value other than true and `RUNNER_NAME_PREFIX` is set to an empty string, it will attempt to use the contents of `/etc/hostname` or fall back to a random string if the file does not exist or is empty. Note: will be overridden by `RUNNER_NAME` if provided. Defaults to `true`. |
| `ACCESS_TOKEN` | A [github PAT](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token) to use to generate `RUNNER_TOKEN` dynamically at container start. Not using this requires a valid `RUNNER_TOKEN` |
| `RUNNER_SCOPE` | The scope the runner will be registered on. Valid values are `repo`, `org` and `ent`. For 'org' and 'enterprise', `ACCESS_TOKEN` is required and `REPO_URL` is unnecessary. If 'org', requires `ORG_NAME`; if 'enterprise', requires `ENTERPRISE_NAME`. Default is 'repo'. |
| `APP_ID` | The github application ID. Must be paired with `APP_PRIVATE_KEY` and should not be used with `ACCESS_TOKEN` or `RUNNER_TOKEN` |
| `APP_PRIVATE_KEY` | The github application private key. Must be paired with `APP_ID` and should not be used with `ACCESS_TOKEN` or `RUNNER_TOKEN` |
| `APP_LOGIN` | The github application login id. Can be paired with `APP_ID` and `APP_PRIVATE_KEY` if default value extracted from `REPO_URL` or `ORG_NAME` is not correct. Note that no default is present when `RUNNER_SCOPE` is 'enterprise'. |
| `RUNNER_SCOPE` | The scope the runner will be registered on. Valid values are `repo`, `org` and `ent`. For 'org' and 'enterprise', `ACCESS_TOKEN` is required and `REPO_URL` is unnecessary. If 'org', requires `ORG_NAME`; if 'ent', requires `ENTERPRISE_NAME`. Default is 'repo'. |
| `ORG_NAME` | The organization name for the runner to register under. Requires `RUNNER_SCOPE` to be 'org'. No default value. |
| `ENTERPRISE_NAME` | The enterprise name for the runner to register under. Requires `RUNNER_SCOPE` to be 'enterprise'. No default value. |
| `LABELS` | A comma separated string to indicate the labels. Default is 'default' |
@@ -70,3 +74,53 @@ These containers are built via Github actions that [copy the dockerfile](https:/
| `CONFIGURED_ACTIONS_RUNNER_FILES_DIR` | Path to use for runner data. It allows avoiding reregistration each the start of the runner. No default value. |
| `EPHEMERAL` | Optional flag to configure runner with [`--ephemeral` option](https://docs.github.com/en/actions/hosting-your-own-runners/autoscaling-with-self-hosted-runners#using-ephemeral-runners-for-autoscaling). Ephemeral runners are suitable for autoscaling. |
| `DISABLE_AUTO_UPDATE` | Optional environment variable to [disable auto updates](https://github.blog/changelog/2022-02-01-github-actions-self-hosted-runners-can-now-disable-automatic-updates/). Auto updates are enabled by default to preserve past behavior. Any value is considered truthy and will disable them. |
| `START_DOCKER_SERVICE` | Optional flag which automatically starts the docker service if set to `true`. Useful when using [sysbox](https://github.com/nestybox/sysbox). Defaults to `false`. |
| `NO_DEFAULT_LABELS` | Optional environment variable to disable adding the default self-hosted, platform, and architecture labels to the runner. Any value is considered truthy and will disable them. |
| `DEBUG_ONLY` | Optional boolean to print debug output but not run any actual registration or runner commands. Used in CI and testing. Default: false |
| `DEBUG_OUTPUT` | Optional boolean to print additional debug output. Default: false |
| `UNSET_CONFIG_VARS` | Optional flag to unset all configuration environment variables after runner setup but before starting the runner. This prevents these variables from leaking into the workflow environment. Set to 'true' to enable. Defaults to 'false' for backward compatibility. |
## Tests ##
Tests are written in [goss](https://github.com/goss-org/goss/) for general assertions.
It's expected that all pull-requests have relevant assertions in order to be merged.
Prereqs: Ensure that docker, goss and dgoss are set up
Note: while testing locally works, github actions will test all variations of operating systems and supported architectures.
The test file expects the image to test as an environment variable `GH_RUNNER_IMAGE` to assist in CI
To test:
```
$ # need to set minimum vars for the goss test interpolation
$ echo "os: ubuntu" >goss_vars.yaml
$ echo "oscodename: focal" >>goss_vars.yaml
$ echo "arch: x86_64" >>goss_vars.yaml
$ docker build -t my-base-test -f Dockerfile.base .
$ # Use the base image in your final
$ sed -i.bak 's/^FROM.*/FROM my-base-test/g' Dockerfile
$ docker build -t my-full-test -f Dockerfile .
$ # Run the full test from Dockerfile.base on the current git HEAD
$ GOSS_VARS=goss_vars.yaml GOSS_FILE=goss_full.yaml GOSS_SLEEP=1 dgoss run --entrypoint /usr/bin/sleep \
-e DEBUG_ONLY=true \
-e RUNNER_NAME=huzzah \
-e REPO_URL=https://github.com/myoung34/docker-github-actions-runner \
-e RUN_AS_ROOT=true \
-e RUNNER_NAME_PREFIX=asdf \
-e ACCESS_TOKEN=1234 \
-e APP_ID=5678 \
-e APP_PRIVATE_KEY=2345 \
-e APP_LOGIN=SOMETHING \
-e RUNNER_SCOPE=org \
-e ORG_NAME=myoung34 \
-e ENTERPRISE_NAME=emyoung34 \
-e LABELS=blue,green \
-e RUNNER_TOKEN=3456 \
-e RUNNER_WORKDIR=/tmp/a \
-e RUNNER_GROUP=wat \
-e GITHUB_HOST=github.example.com \
-e DISABLE_AUTOMATIC_DEREGISTRATION=true \
-e EPHEMERAL=true \
-e DISABLE_AUTO_UPDATE=true \
my-full-test 10
```
+89
View File
@@ -0,0 +1,89 @@
#!/bin/bash
#
# Request an ACCESS_TOKEN to be used by a GitHub APP
# Environment variable that need to be set up:
# * APP_ID, the GitHub's app ID
# * APP_PRIVATE_KEY, the content of GitHub app's private key in PEM format.
# * APP_LOGIN, the login name used to install GitHub's app
#
# https://github.com/orgs/community/discussions/24743#discussioncomment-3245300
#
set -o pipefail
_GITHUB_HOST=${GITHUB_HOST:="github.com"}
# If URL is not github.com then use the enterprise api endpoint
if [[ ${GITHUB_HOST} = "github.com" ]]; then
URI="https://api.${_GITHUB_HOST}"
else
URI="https://${_GITHUB_HOST}/api/v3"
fi
API_VERSION=v3
API_HEADER="Accept: application/vnd.github.${API_VERSION}+json"
CONTENT_LENGTH_HEADER="Content-Length: 0"
APP_INSTALLATIONS_URI="${URI}/app/installations"
# JWT parameters based off
# https://docs.github.com/en/developers/apps/building-github-apps/authenticating-with-github-apps#authenticating-as-a-github-app
#
# JWT token issuance and expiration parameters
JWT_IAT_DRIFT=60
JWT_EXP_DELTA=600
JWT_JOSE_HEADER='{
"alg": "RS256",
"typ": "JWT"
}'
build_jwt_payload() {
now=$(date +%s)
iat=$((now - JWT_IAT_DRIFT))
jq -c \
--arg iat_str "${iat}" \
--arg exp_delta_str "${JWT_EXP_DELTA}" \
--arg app_id_str "${APP_ID}" \
'
($iat_str | tonumber) as $iat
| ($exp_delta_str | tonumber) as $exp_delta
| ($app_id_str | tonumber) as $app_id
| .iat = $iat
| .exp = ($iat + $exp_delta)
| .iss = $app_id
' <<< "{}" | tr -d '\n'
}
base64url() {
base64 | tr '+/' '-_' | tr -d '=\n'
}
rs256_sign() {
openssl dgst -binary -sha256 -sign <(echo "$1")
}
request_access_token() {
jwt_payload=$(build_jwt_payload)
encoded_jwt_parts=$(base64url <<<"${JWT_JOSE_HEADER}").$(base64url <<<"${jwt_payload}")
encoded_mac=$(echo -n "${encoded_jwt_parts}" | rs256_sign "${APP_PRIVATE_KEY}" | base64url)
generated_jwt="${encoded_jwt_parts}.${encoded_mac}"
auth_header="Authorization: Bearer ${generated_jwt}"
app_installations_response=$(curl -sX GET \
-H "${auth_header}" \
-H "${API_HEADER}" \
"${APP_INSTALLATIONS_URI}" \
)
access_token_url=$(echo "${app_installations_response}" | jq --raw-output '.[] | select (.account.login == "'"${APP_LOGIN}"'" and .app_id == '"${APP_ID}"') .access_tokens_url')
curl -sX POST \
-H "${CONTENT_LENGTH_HEADER}" \
-H "${auth_header}" \
-H "${API_HEADER}" \
"${access_token_url}" | \
jq --raw-output .token
}
request_access_token
+113
View File
@@ -0,0 +1,113 @@
{
"user": {
"user-id": 1001,
"group-id": 121
},
"install": [
{
"category": "aws",
"source": "script",
"packages": [
"aws-cli"
]
},
{
"category": "development",
"source": "apt",
"packages": [
"build-essential",
"zlib1g-dev",
"zstd",
"gettext",
"libcurl4-openssl-dev",
"libpq-dev",
"pkg-config",
"software-properties-common"
]
},
{
"category": "container-tools",
"source": "script",
"packages": [
"container-tools"
]
},
{
"category": "debugging",
"source": "script",
"packages": [
"liblttng-ust"
]
},
{
"category": "docker-cli",
"source": "script",
"packages": [
"docker-cli"
]
},
{
"category": "docker",
"source": "script",
"packages": [
"docker"
]
},
{
"category": "git",
"source": "script",
"packages": [
"git",
"git-lfs"
]
},
{
"category": "github",
"source": "script",
"packages": [
"github-cli"
]
},
{
"category": "network-tools",
"source": "apt",
"packages": [
"inetutils-ping",
"wget",
"openssh-client",
"rsync"
]
},
{
"category": "node",
"source": "apt",
"packages": [
"nodejs"
]
},
{
"category": "powershell",
"source": "script",
"packages": [
"powershell"
]
},
{
"category": "python",
"source": "apt",
"packages": [
"python3",
"python3-pip",
"python3-setuptools",
"python3-venv"
]
},
{
"category": "yq",
"source": "script",
"packages": [
"yq"
]
}
]
}
+22
View File
@@ -0,0 +1,22 @@
#!/usr/bin/env bash
set -euo pipefail
function config_file() {
echo "$(dirname "${BASH_SOURCE[0]}")/config.json"
}
function user_id() {
jq -r '.user."user-id"' "$(config_file)"
}
function group_id() {
jq -r '.user."group-id"' "$(config_file)"
}
function apt_packages() {
jq -r '.install[] | select(.source == "apt") | .packages[]' "$(config_file)" | paste -sd ' ' -
}
function script_packages() {
jq -r '.install[] | select(.source == "script") | .packages[]' "$(config_file)"
}
+63
View File
@@ -0,0 +1,63 @@
#!/usr/bin/env bash
set -euo pipefail
# Required by the build or runner operation
function install_essentials() {
apt-get install -y --no-install-recommends \
ca-certificates \
curl \
jq \
gnupg \
tar \
unzip \
zip \
apt-transport-https \
sudo \
dirmngr \
locales \
gosu \
gpg-agent \
dumb-init \
libc-bin
}
function install_tools_apt() {
apt_packages | xargs apt-get install -y --no-install-recommends
}
function remove_caches() {
rm -rf /var/lib/apt/lists/*
rm -rf /tmp/*
}
function setup_sudoers() {
sed -e 's/Defaults.*env_reset/Defaults env_keep = "HTTP_PROXY HTTPS_PROXY NO_PROXY FTP_PROXY http_proxy https_proxy no_proxy ftp_proxy"/' -i /etc/sudoers
echo '%sudo ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
}
echo en_US.UTF-8 UTF-8 >> /etc/locale.gen
scripts_dir=$(dirname "$0")
# shellcheck source=/dev/null
source "$scripts_dir/sources.sh"
# shellcheck source=/dev/null
source "$scripts_dir/tools.sh"
# shellcheck source=/dev/null
source "$scripts_dir/config.sh"
apt-get update
install_essentials
configure_sources
apt-get update
install_tools_apt
install_tools
setup_sudoers
groupadd -g "$(group_id)" runner
useradd -mr -d /home/runner -u "$(user_id)" -g "$(group_id)" runner
usermod -aG sudo runner
usermod -aG docker runner
remove_sources
remove_caches
+60
View File
@@ -0,0 +1,60 @@
#!/usr/bin/env bash
set -euo pipefail
function configure_git() {
# shellcheck source=/dev/null
source /etc/os-release
local GIT_CORE_PPA_KEY="A1715D88E1DF1F24"
gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys ${GIT_CORE_PPA_KEY}
gpg --export ${GIT_CORE_PPA_KEY} | gpg --dearmor -o /usr/share/keyrings/git-core.gpg
if [[ "${VERSION_CODENAME}" == "focal" ]]; then
local GIT_CORE_FOCAL_PPA_KEY="E363C90F8F1B6217"
local KEYRING_FILE="/usr/share/keyrings/git-core-focal.gpg"
gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys ${GIT_CORE_FOCAL_PPA_KEY}
gpg --export ${GIT_CORE_FOCAL_PPA_KEY} | gpg --dearmor -o "${KEYRING_FILE}"
echo deb [signed-by=${KEYRING_FILE}] http://ppa.launchpad.net/git-core/ppa/ubuntu focal main>/etc/apt/sources.list.d/git-core.list
fi
}
function configure_docker() {
# shellcheck source=/dev/null
source /etc/os-release
mkdir -p /etc/apt/keyrings
curl -fsSL "https://download.docker.com/linux/$ID/gpg" | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
local version DPKG_ARCH
version=$(echo "$VERSION_CODENAME" | sed 's/trixie\|n\/a/bookworm/g')
DPKG_ARCH="$(dpkg --print-architecture)"
echo "deb [arch=${DPKG_ARCH} signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/$ID ${version} stable" \
| tee /etc/apt/sources.list.d/docker.list > /dev/null
}
function configure_container_tools() {
# shellcheck source=/dev/null
source /etc/os-release
if [[ "${VERSION_CODENAME}" == "focal" ]]; then
echo "available in 20.10 and higher"
echo "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_20.04/ /" \
| tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
curl -L "https://build.opensuse.org/projects/devel:kubic/signing_keys/download?kind=gpg" \
| /usr/bin/apt-key add -
fi
}
function configure_sources() {
configure_git
configure_docker
configure_container_tools
}
function remove_sources() {
rm -f /etc/apt/sources.list.d/git-core.list
rm -f /etc/apt/sources.list.d/docker.list
rm -f /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
}
+124
View File
@@ -0,0 +1,124 @@
#!/usr/bin/env bash
set -euo pipefail
function install_git() {
( apt-get install -y --no-install-recommends git \
|| apt-get install -t stable -y --no-install-recommends git )
}
function install_liblttng-ust() {
if [[ $(apt-cache search -n liblttng-ust0 | awk '{print $1}') == "liblttng-ust0" ]]; then
apt-get install -y --no-install-recommends liblttng-ust0
fi
if [[ $(apt-cache search -n liblttng-ust1 | awk '{print $1}') == "liblttng-ust1" ]]; then
apt-get install -y --no-install-recommends liblttng-ust1
fi
}
function install_aws-cli() {
( curl "https://awscli.amazonaws.com/awscli-exe-linux-$(uname -m).zip" -o "awscliv2.zip" \
&& unzip -q awscliv2.zip -d /tmp/ \
&& /tmp/aws/install \
&& rm awscliv2.zip \
) \
|| pip3 install --no-cache-dir awscli
}
function install_git-lfs() {
local DPKG_ARCH
DPKG_ARCH="$(dpkg --print-architecture)"
curl -s "https://github.com/git-lfs/git-lfs/releases/download/v${GIT_LFS_VERSION}/git-lfs-linux-${DPKG_ARCH}-v${GIT_LFS_VERSION}.tar.gz" -L -o /tmp/lfs.tar.gz
tar -xzf /tmp/lfs.tar.gz -C /tmp
"/tmp/git-lfs-${GIT_LFS_VERSION}/install.sh"
rm -rf /tmp/lfs.tar.gz "/tmp/git-lfs-${GIT_LFS_VERSION}"
}
function install_docker-cli() {
apt-get install -y docker-ce-cli --no-install-recommends --allow-unauthenticated
}
function install_docker() {
apt-get install -y docker-ce docker-ce-cli docker-buildx-plugin containerd.io docker-compose-plugin --no-install-recommends --allow-unauthenticated
echo -e '#!/bin/sh\ndocker compose --compatibility "$@"' > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
sed -i 's/ulimit -Hn/# ulimit -Hn/g' /etc/init.d/docker
}
function install_container-tools() {
( apt-get install -y --no-install-recommends podman buildah skopeo || : )
}
function install_github-cli() {
local DPKG_ARCH GH_CLI_VERSION GH_CLI_DOWNLOAD_URL
DPKG_ARCH="$(dpkg --print-architecture)"
GH_CLI_VERSION=$(curl -sL -H "Accept: application/vnd.github+json" \
https://api.github.com/repos/cli/cli/releases/latest \
| jq -r '.tag_name' | sed 's/^v//g')
GH_CLI_DOWNLOAD_URL=$(curl -sL -H "Accept: application/vnd.github+json" \
https://api.github.com/repos/cli/cli/releases/latest \
| jq ".assets[] | select(.name == \"gh_${GH_CLI_VERSION}_linux_${DPKG_ARCH}.deb\")" \
| jq -r '.browser_download_url')
curl -sSLo /tmp/ghcli.deb "${GH_CLI_DOWNLOAD_URL}"
apt-get -y install /tmp/ghcli.deb
rm /tmp/ghcli.deb
}
function install_yq() {
local DPKG_ARCH YQ_DOWNLOAD_URL
DPKG_ARCH="$(dpkg --print-architecture)"
YQ_DOWNLOAD_URL=$(curl -sL -H "Accept: application/vnd.github+json" \
https://api.github.com/repos/mikefarah/yq/releases/latest \
| jq ".assets[] | select(.name == \"yq_linux_${DPKG_ARCH}.tar.gz\")" \
| jq -r '.browser_download_url')
curl -s "${YQ_DOWNLOAD_URL}" -L -o /tmp/yq.tar.gz
tar -xzf /tmp/yq.tar.gz -C /tmp
mv "/tmp/yq_linux_${DPKG_ARCH}" /usr/local/bin/yq
}
function install_powershell() {
local DPKG_ARCH PWSH_VERSION PWSH_DOWNLOAD_URL
DPKG_ARCH="$(dpkg --print-architecture)"
PWSH_VERSION=$(curl -sL -H "Accept: application/vnd.github+json" \
https://api.github.com/repos/PowerShell/PowerShell/releases/latest \
| jq -r '.tag_name' \
| sed 's/^v//g')
PWSH_DOWNLOAD_URL=$(curl -sL -H "Accept: application/vnd.github+json" \
https://api.github.com/repos/PowerShell/PowerShell/releases/latest \
| jq -r ".assets[] | select(.name == \"powershell-${PWSH_VERSION}-linux-${DPKG_ARCH//amd64/x64}.tar.gz\") | .browser_download_url")
curl -L -o /tmp/powershell.tar.gz "$PWSH_DOWNLOAD_URL"
mkdir -p /opt/powershell
tar zxf /tmp/powershell.tar.gz -C /opt/powershell
chmod +x /opt/powershell/pwsh
ln -s /opt/powershell/pwsh /usr/bin/pwsh
}
function install_tools() {
local function_name
# shellcheck source=/dev/null
source "$(dirname "${BASH_SOURCE[0]}")/config.sh"
script_packages | while read -r package; do
function_name="install_${package}"
if declare -f "${function_name}" > /dev/null; then
"${function_name}"
else
echo "No install script found for package: ${package}"
exit 1
fi
done
}
+175 -26
View File
@@ -2,35 +2,68 @@
# shellcheck shell=bash
export RUNNER_ALLOW_RUNASROOT=1
export PATH=$PATH:/actions-runner
export PATH=${PATH}:/actions-runner
# Un-export these, so that they must be passed explicitly to the environment of
# any command that needs them. This may help prevent leaks.
export -n ACCESS_TOKEN
export -n RUNNER_TOKEN
export -n APP_ID
export -n APP_PRIVATE_KEY
trap_with_arg() {
func="$1" ; shift
for sig ; do
# shellcheck disable=SC2064
trap "$func $sig" "$sig"
done
}
deregister_runner() {
echo "Caught SIGTERM. Deregistering runner"
echo "Caught $1 - Deregistering runner"
if [[ -n "${ACCESS_TOKEN}" ]]; then
_TOKEN=$(ACCESS_TOKEN="${ACCESS_TOKEN}" bash /token.sh)
RUNNER_TOKEN=$(echo "${_TOKEN}" | jq -r .token)
fi
./config.sh remove --token "${RUNNER_TOKEN}"
[[ -f "/actions-runner/.runner" ]] && rm -f /actions-runner/.runner
exit
}
_DEBUG_ONLY=${DEBUG_ONLY:-false}
_DEBUG_OUTPUT=${DEBUG_OUTPUT:-false}
_DISABLE_AUTOMATIC_DEREGISTRATION=${DISABLE_AUTOMATIC_DEREGISTRATION:-false}
_RANDOM_RUNNER_SUFFIX=${RANDOM_RUNNER_SUFFIX:="true"}
_RUNNER_NAME=${RUNNER_NAME:-${RUNNER_NAME_PREFIX:-github-runner}-$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 13 ; echo '')}
_RUNNER_WORKDIR=${RUNNER_WORKDIR:-/_work}
if [[ ${RANDOM_RUNNER_SUFFIX} != "true" ]]; then
# In some cases this file does not exist
if [[ -f "/etc/hostname" ]]; then
# in some cases it can also be empty
if [[ $(stat --printf="%s" /etc/hostname) -ne 0 ]]; then
_RUNNER_NAME_PREFIX=${RUNNER_NAME_PREFIX-"github-runner"}
_RUNNER_NAME=${RUNNER_NAME:-${_RUNNER_NAME_PREFIX:+${_RUNNER_NAME_PREFIX}-}$(cat /etc/hostname)}
echo "RANDOM_RUNNER_SUFFIX is ${RANDOM_RUNNER_SUFFIX}. /etc/hostname exists and has content. Setting runner name to ${_RUNNER_NAME}"
else
echo "RANDOM_RUNNER_SUFFIX is ${RANDOM_RUNNER_SUFFIX} ./etc/hostname exists but is empty. Not using /etc/hostname."
fi
else
echo "RANDOM_RUNNER_SUFFIX is ${RANDOM_RUNNER_SUFFIX} but /etc/hostname does not exist. Not using /etc/hostname."
fi
fi
_RUNNER_WORKDIR=${RUNNER_WORKDIR:-/_work/${_RUNNER_NAME}}
_LABELS=${LABELS:-default}
_RUNNER_GROUP=${RUNNER_GROUP:-Default}
_GITHUB_HOST=${GITHUB_HOST:="github.com"}
_RUN_AS_ROOT=${RUN_AS_ROOT:="true"}
_EPHEMERAL=""
_START_DOCKER_SERVICE=${START_DOCKER_SERVICE:="false"}
_UNSET_CONFIG_VARS=${UNSET_CONFIG_VARS:="false"}
_CONFIGURED_ACTIONS_RUNNER_FILES_DIR=${CONFIGURED_ACTIONS_RUNNER_FILES_DIR:-""}
# ensure backwards compatibility
if [[ -z $RUNNER_SCOPE ]]; then
if [[ -z ${RUNNER_SCOPE} ]]; then
if [[ ${ORG_RUNNER} == "true" ]]; then
echo 'ORG_RUNNER is now deprecated. Please use RUNNER_SCOPE="org" instead.'
export RUNNER_SCOPE="org"
@@ -46,6 +79,9 @@ case ${RUNNER_SCOPE} in
[[ -z ${ORG_NAME} ]] && ( echo "ORG_NAME required for org runners"; exit 1 )
_SHORT_URL="https://${_GITHUB_HOST}/${ORG_NAME}"
RUNNER_SCOPE="org"
if [[ -n "${APP_ID}" ]] && [[ -z "${APP_LOGIN}" ]]; then
APP_LOGIN=${ORG_NAME}
fi
;;
ent*)
@@ -58,10 +94,29 @@ case ${RUNNER_SCOPE} in
[[ -z ${REPO_URL} ]] && ( echo "REPO_URL required for repo runners"; exit 1 )
_SHORT_URL=${REPO_URL}
RUNNER_SCOPE="repo"
if [[ -n "${APP_ID}" ]] && [[ -z "${APP_LOGIN}" ]]; then
APP_LOGIN=${REPO_URL%/*}
APP_LOGIN=${APP_LOGIN##*/}
fi
;;
esac
configure_runner() {
ARGS=()
if [[ -n "${APP_ID}" ]] && [[ -n "${APP_PRIVATE_KEY}" ]] && [[ -n "${APP_LOGIN}" ]]; then
if [[ -n "${ACCESS_TOKEN}" ]] || [[ -n "${RUNNER_TOKEN}" ]]; then
echo "ERROR: ACCESS_TOKEN or RUNNER_TOKEN provided but are mutually exclusive with APP_ID, APP_PRIVATE_KEY and APP_LOGIN." >&2
exit 1
fi
echo "Obtaining access token for app_id ${APP_ID} and login ${APP_LOGIN}"
nl="
"
ACCESS_TOKEN=$(APP_ID="${APP_ID}" APP_PRIVATE_KEY="${APP_PRIVATE_KEY//\\n/${nl}}" APP_LOGIN="${APP_LOGIN}" bash /app_token.sh)
elif [[ -n "${APP_ID}" ]] || [[ -n "${APP_PRIVATE_KEY}" ]] || [[ -n "${APP_LOGIN}" ]]; then
echo "ERROR: All of APP_ID, APP_PRIVATE_KEY and APP_LOGIN must be specified." >&2
exit 1
fi
if [[ -n "${ACCESS_TOKEN}" ]]; then
echo "Obtaining the token of the runner"
_TOKEN=$(ACCESS_TOKEN="${ACCESS_TOKEN}" bash /token.sh)
@@ -71,14 +126,17 @@ configure_runner() {
# shellcheck disable=SC2153
if [ -n "${EPHEMERAL}" ]; then
echo "Ephemeral option is enabled"
_EPHEMERAL="--ephemeral"
ARGS+=("--ephemeral")
fi
if [ -n "${DISABLE_AUTO_UPDATE}" ]; then
echo "Disable auto update option is enabled"
_AUTO_UPDATE="--disableupdate"
else
_AUTO_UPDATE=""
ARGS+=("--disableupdate")
fi
if [ -n "${NO_DEFAULT_LABELS}" ]; then
echo "Disable adding the default self-hosted, platform, and architecture labels"
ARGS+=("--no-default-labels")
fi
echo "Configuring"
@@ -91,60 +149,151 @@ configure_runner() {
--runnergroup "${_RUNNER_GROUP}" \
--unattended \
--replace \
"${_EPHEMERAL}" \
"${_AUTO_UPDATE}"
"${ARGS[@]}"
[[ ! -d "${_RUNNER_WORKDIR}" ]] && mkdir "${_RUNNER_WORKDIR}"
[[ ! -d "${_RUNNER_WORKDIR}" ]] && mkdir -p "${_RUNNER_WORKDIR}"
}
unset_config_vars() {
echo "Unsetting configuration environment variables"
unset RUN_AS_ROOT
unset RUNNER_NAME
unset RUNNER_NAME_PREFIX
unset RANDOM_RUNNER_SUFFIX
unset ACCESS_TOKEN
unset APP_ID
unset APP_PRIVATE_KEY
unset APP_LOGIN
unset RUNNER_SCOPE
unset ORG_NAME
unset ENTERPRISE_NAME
unset LABELS
unset REPO_URL
unset RUNNER_TOKEN
unset RUNNER_WORKDIR
unset RUNNER_GROUP
unset GITHUB_HOST
unset DISABLE_AUTOMATIC_DEREGISTRATION
unset CONFIGURED_ACTIONS_RUNNER_FILES_DIR
unset EPHEMERAL
unset DISABLE_AUTO_UPDATE
unset START_DOCKER_SERVICE
unset NO_DEFAULT_LABELS
unset UNSET_CONFIG_VARS
}
# Opt into runner reusage because a value was given
if [[ -n "${CONFIGURED_ACTIONS_RUNNER_FILES_DIR}" ]]; then
if [[ -n "${_CONFIGURED_ACTIONS_RUNNER_FILES_DIR}" ]]; then
echo "Runner reusage is enabled"
# directory exists, copy the data
if [[ -d "${CONFIGURED_ACTIONS_RUNNER_FILES_DIR}" ]]; then
if [[ -d "${_CONFIGURED_ACTIONS_RUNNER_FILES_DIR}" ]]; then
echo "Copying previous data"
cp -p -r "${CONFIGURED_ACTIONS_RUNNER_FILES_DIR}/." "/actions-runner"
cp -p -r "${_CONFIGURED_ACTIONS_RUNNER_FILES_DIR}/." "/actions-runner"
fi
if [ -f "/actions-runner/.runner" ]; then
echo "The runner has already been configured"
else
configure_runner
if [[ ${_DEBUG_ONLY} == "false" ]]; then
configure_runner
fi
fi
else
echo "Runner reusage is disabled"
configure_runner
if [[ ${_DEBUG_ONLY} == "false" ]]; then
[[ -f "/actions-runner/.runner" ]] && rm -f /actions-runner/.runner
configure_runner
fi
fi
if [[ -n "${CONFIGURED_ACTIONS_RUNNER_FILES_DIR}" ]]; then
echo "Reusage is enabled. Storing data to ${CONFIGURED_ACTIONS_RUNNER_FILES_DIR}"
if [[ -n "${_CONFIGURED_ACTIONS_RUNNER_FILES_DIR}" ]]; then
echo "Reusage is enabled. Storing data to ${_CONFIGURED_ACTIONS_RUNNER_FILES_DIR}"
if [[ ${_DISABLE_AUTOMATIC_DEREGISTRATION} == "false" ]]; then
echo "DISABLE_AUTOMATIC_DEREGISTRATION should be set to true to avoid issues with re-using a deregistered runner."
exit 1
fi
# Quoting (even with double-quotes) the regexp brokes the copying
cp -p -r "/actions-runner/_diag" "/actions-runner/svc.sh" /actions-runner/.[^.]* "${CONFIGURED_ACTIONS_RUNNER_FILES_DIR}"
cp -p -r "/actions-runner/_diag" "/actions-runner/svc.sh" /actions-runner/.[^.]* "${_CONFIGURED_ACTIONS_RUNNER_FILES_DIR}"
fi
if [[ ${_DISABLE_AUTOMATIC_DEREGISTRATION} == "false" ]]; then
trap deregister_runner SIGINT SIGQUIT SIGTERM INT TERM QUIT
if [[ ${_DEBUG_ONLY} == "false" ]]; then
trap_with_arg deregister_runner SIGINT SIGQUIT SIGTERM INT TERM QUIT
fi
fi
# Start docker service if needed (e.g. for docker-in-docker)
if [[ ${_START_DOCKER_SERVICE} == "true" ]]; then
echo "Starting docker service"
_PREFIX=""
[[ ${_RUN_AS_ROOT} != "true" ]] && _PREFIX="sudo"
if [[ ${_DEBUG_ONLY} == "true" ]]; then
echo ${_PREFIX} service docker start
else
${_PREFIX} service docker start
fi
fi
# Unset configuration environment variables if the flag is set
if [[ ${_UNSET_CONFIG_VARS} == "true" ]]; then
unset_config_vars
fi
# Container's command (CMD) execution as runner user
if [[ ${_DEBUG_ONLY} == "true" ]] || [[ ${_DEBUG_OUTPUT} == "true" ]] ; then
echo ""
echo "Disable automatic registration: ${_DISABLE_AUTOMATIC_DEREGISTRATION}"
echo "Random runner suffix: ${_RANDOM_RUNNER_SUFFIX}"
echo "Runner name: ${_RUNNER_NAME}"
echo "Runner workdir: ${_RUNNER_WORKDIR}"
echo "Labels: ${_LABELS}"
echo "Runner Group: ${_RUNNER_GROUP}"
echo "Github Host: ${_GITHUB_HOST}"
echo "Run as root:${_RUN_AS_ROOT}"
echo "Start docker: ${_START_DOCKER_SERVICE}"
fi
if [[ ${_RUN_AS_ROOT} == "true" ]]; then
if [[ $(id -u) -eq 0 ]]; then
"$@"
if [[ ${_DEBUG_ONLY} == "true" ]] || [[ ${_DEBUG_OUTPUT} == "true" ]] ; then
# shellcheck disable=SC2145
echo "Running $@"
fi
if [[ ${_DEBUG_ONLY} == "false" ]]; then
"$@"
fi
else
echo "ERROR: RUN_AS_ROOT env var is set to true but the user has been overridden and is not running as root, but UID '$(id -u)'"
exit 1
fi
else
if [[ $(id -u) -eq 0 ]]; then
[[ -n "${CONFIGURED_ACTIONS_RUNNER_FILES_DIR}" ]] && /usr/bin/chown -R runner "${CONFIGURED_ACTIONS_RUNNER_FILES_DIR}"
/usr/bin/chown -R runner "${_RUNNER_WORKDIR}" /opt/hostedtoolcache/ /actions-runner
/usr/sbin/gosu runner "$@"
[[ -n "${_CONFIGURED_ACTIONS_RUNNER_FILES_DIR}" ]] && chown -R runner "${_CONFIGURED_ACTIONS_RUNNER_FILES_DIR}"
chown -R runner "${_RUNNER_WORKDIR}" /actions-runner
# The toolcache is not recursively chowned to avoid recursing over prepulated tooling in derived docker images
chown runner /opt/hostedtoolcache/
if [[ ${_DEBUG_ONLY} == "true" ]] || [[ ${_DEBUG_OUTPUT} == "true" ]] ; then
# shellcheck disable=SC2145
echo "Running /usr/sbin/gosu runner $@"
fi
if [[ ${_DEBUG_ONLY} == "false" ]]; then
/usr/sbin/gosu runner "$@"
fi
else
"$@"
if [[ ${_DEBUG_ONLY} == "true" ]] || [[ ${_DEBUG_OUTPUT} == "true" ]] ; then
# shellcheck disable=SC2145
echo "Running $@"
fi
if [[ ${_DEBUG_ONLY} == "false" ]]; then
"$@"
fi
fi
fi
+89
View File
@@ -0,0 +1,89 @@
package:
curl:
installed: true
docker:
installed: false
docker-compose:
installed: false
git:
installed: true
git-lfs:
installed: false
jq:
installed: true
lsb_release:
installed: false
make:
installed: true
pwsh:
installed: false
python3:
installed: true
rsync:
installed: true
ssh:
installed: false
sudo:
installed: true
tar:
installed: true
unzip:
installed: true
wget:
installed: true
yq:
installed: false
# Ubuntu Focal is the only one currently that doesnt have an official upstream skopeo/buildah/podman
{{ if not (eq .Vars.oscodename "focal") }}
skopeo:
installed: true
buildah:
installed: true
podman:
installed: true
{{ end }}
file:
/usr/bin/gh:
exists: true
/usr/bin/nodejs:
exists: true
/usr/sbin/gosu:
exists: true
/usr/bin/dumb-init:
exists: true
/etc/init.d/docker:
exists: true
owner: root
group: root
filetype: file
contents:
- /^\s*# ulimit -Hn/
/etc/sudoers:
exists: true
owner: root
group: root
filetype: file
contents:
- '/%sudo ALL=\(ALL\) NOPASSWD: ALL/'
- '/Defaults env_keep = "HTTP_PROXY HTTPS_PROXY NO_PROXY FTP_PROXY http_proxy https_proxy no_proxy ftp_proxy"/'
/etc/locale.gen:
exists: true
owner: root
group: root
filetype: file
contents:
- '/^en_US.UTF-8 UTF-8/'
user:
runner:
exists: true
uid: 1001
gid: 121
groups:
- runner
- sudo
- docker
group:
runner:
exists: true
gid: 121
+18
View File
@@ -0,0 +1,18 @@
command:
/entrypoint.sh something:
exit-status: 0
stdout:
- "Runner reusage is disabled"
- ""
- "Disable automatic registration: true"
- "Random runner suffix: true"
- "Runner workdir: /tmp/a"
- "Runner name: huzzah"
- "Labels: blue,green"
- "Runner Group: wat"
- "Github Host: github.example.com"
- "Run as root:true"
- "Start docker: false"
- "Running something"
stderr: ""
timeout: 2000
+20
View File
@@ -0,0 +1,20 @@
command:
/entrypoint.sh something:
exit-status: 0
stdout:
- REPO_URL required for repo runners
- Runner reusage is disabled
- ""
- 'Disable automatic registration: false'
- 'Random runner suffix: true'
- 'Runner name: test'
- 'Runner workdir: /_work/test'
- 'Labels: default'
- 'Runner Group: Default'
- 'Github Host: github.com'
- Run as root:true
- 'Start docker: false'
- Running something
- ""
stderr: ""
timeout: 2000
+9
View File
@@ -0,0 +1,9 @@
command:
/entrypoint.sh something:
exit-status: 1
stdout:
- "Runner reusage is enabled"
- "Reusage is enabled. Storing data to /runner/data"
- "DISABLE_AUTOMATIC_DEREGISTRATION should be set to true to avoid issues with re-using a deregistered runner."
stderr: ""
timeout: 2000
+1 -1
View File
@@ -10,4 +10,4 @@ curl -L "https://github.com/actions/runner/releases/download/v${GH_RUNNER_VERSIO
tar -zxf actions.tar.gz
rm -f actions.tar.gz
./bin/installdependencies.sh
mkdir /_work
mkdir -p /_work
+23
View File
@@ -0,0 +1,23 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base",
"helpers:pinGitHubActionDigests"
],
"packageRules": [
{
"matchUpdateTypes": ["minor", "patch", "pin", "digest"],
"automerge": true
},
{
"matchDepTypes": ["devDependencies"],
"automerge": true
},
{
"matchManagers": ["github-actions"],
"matchPackagePatterns": [".*"],
"versioning": "digest"
}
],
"platformAutomerge": true
}