diff --git a/.all-contributorsrc b/.all-contributorsrc index 4309328d..5337f3ba 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -334,6 +334,26 @@ "contributions": [ "research" ] + }, + { + "login": "TechnicallyJoe", + "name": "Jonathan Østrup", + "avatar_url": "https://avatars.githubusercontent.com/u/7877957?v=4", + "profile": "https://github.com/technicallyjoe", + "contributions": [ + "ideas", + "code" + ] + }, + { + "login": "icco", + "name": "Nat Welch", + "avatar_url": "https://avatars.githubusercontent.com/u/20201?v=4", + "profile": "https://natwelch.com", + "contributions": [ + "bug", + "code" + ] } ], "contributorsPerLine": 7, diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index ded7682d..aa8d45ea 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -1,9 +1,9 @@ +--- #------------------------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information. #------------------------------------------------------------------------------------------------------------- -version: '3.7' services: # Update this to the name of the service you want to work with in your docker-compose.yml file dev: @@ -11,7 +11,7 @@ services: # to cause all processes to run as this user. Once present, you can also simply # use the "remoteUser" property in devcontainer.json if you just want VS Code and # its sub-processes (terminals, tasks, debugging) to execute as the user. On Linux, - # you may need to ensure the UID and GID of the container user you create matches your + # you may need to ensure the UID and GID of the container user you create matches your # local user. See https://aka.ms/vscode-remote/containers/non-root for details. # user: vscode @@ -23,13 +23,13 @@ services: # Uncomment if you want to expose any additional ports. The snippet below exposes port 3000. # ports: # - 3000:3000 - + volumes: # Update this to wherever you want VS Code to mount the folder of your project - .:/workspace:cached # Uncomment the next line to use Docker from inside the container. See https://aka.ms/vscode-remote/samples/docker-in-docker-compose for details. - # - /var/run/docker.sock:/var/run/docker.sock + # - /var/run/docker.sock:/var/run/docker.sock # Uncomment the next four lines if you will use a ptrace-based debugger like C++, Go, and Rust. # cap_add: @@ -39,4 +39,3 @@ services: # Overrides default command so things don't shut down after the process ends. command: /bin/sh -c "while sleep 1000; do :; done" - diff --git a/.github/workflows/release_please.yml b/.github/workflows/release_please.yml index 939642aa..64869d9a 100644 --- a/.github/workflows/release_please.yml +++ b/.github/workflows/release_please.yml @@ -23,7 +23,7 @@ jobs: release_created: ${{ steps.release.outputs.release_created }} tag_name: ${{ steps.release.outputs.tag_name }} steps: - - uses: google-github-actions/release-please-action@v4 + - uses: googleapis/release-please-action@v4 id: release with: release-type: simple diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f6047153..194c6110 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,3 +29,24 @@ jobs: env: FORMER_OUTPUT_PR_BRANCH: ${{ steps.test.outputs.pr_branch }} run: echo "pr_branch ${FORMER_OUTPUT_PR_BRANCH}" + + test-implementation-job-no-dry-run: + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + steps: + # To use this repository's private action, you must check out the repository + - name: Checkout + uses: actions/checkout@v4 + - name: Test action step + id: test + uses: ./ # Uses an action in the root directory + with: + source_repo_path: AndreasAugustin/template.git + is_dry_run: false + is_force_push_pr: true + - name: print output + env: + FORMER_OUTPUT_PR_BRANCH: ${{ steps.test.outputs.pr_branch }} + run: echo "pr_branch ${FORMER_OUTPUT_PR_BRANCH}" diff --git a/Dockerfile b/Dockerfile index 19752698..375b6ddc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -54,7 +54,7 @@ ENTRYPOINT ["/bin/zsh"] ####################################### # image for creating the documentation ###################################### -FROM node:22.9.0-alpine AS docs +FROM node:23.0.0-alpine AS docs # install packages RUN apk add --update --no-cache bash make git zsh curl tmux diff --git a/README.md b/README.md index 969e871e..b782d220 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # actions-template-sync -[![All Contributors](https://img.shields.io/badge/all_contributors-33-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-35-orange.svg?style=flat-square)](#contributors-) [![actions-template-sync](https://github.com/AndreasAugustin/actions-template-sync/actions/workflows/actions_template_sync.yml/badge.svg)](https://github.com/AndreasAugustin/actions-template-sync/actions/workflows/actions_template_sync.yml) @@ -269,6 +269,8 @@ jobs: | gpg_private_key | `[optional]` set if you want to sign commits | `false` | | | gpg_passphrase | `[optional]` set if your optionial gpg private key has a passphrase | `false` | | | steps | `[optional] add the steps you want to execute within the action` | `false` | all steps will be executed | +| template_sync_ignore_file_path | `[optional] set the path to the ignore file.` | false |`.templatesyncignore` | +| is_with_tags | `[optional]` set to `true` if tags should be synced | `false` | `false` | ### Action Outputs @@ -315,6 +317,11 @@ in defining the files and folders that should be excluded from syncing with the It can also be stored inside `.github` folder. +The `template_sync_ignore_file_path` parameter allows you to specify a path to an ignore file. This variable defaults to `.templatesyncignore`. +Changing this allows you to support template sync with more than one repository using different ignore files. + +The action will look for the path specified within `.` or `.github/` + _Note: It is not possible to sync also the `.templatesyncignore` itself. Any changes from the template repository will be restored automatically._ **Remark** reading the [gitglossary][git-glossary] (_pathspec_ section) you see a slight difference to the `.gitignore` file @@ -568,6 +575,30 @@ This feature will force delete files if those are deelted within the source repo :warning: it is highly related to the `git_remote_pull_params` config parameter and won't work with the default. You need to change the default one e.g. to `git_remote_pull_params: --allow-unrelated-histories --strategy=recursive --no-edit`. +## GHES and custom runners + +Some notes if you use GitHub Enterprise Server (GHES) and/or custom runners. +The action script is based on bash. That means your runner must be able to run bash scripts. +Furthermore you need to have the following command line tools installed: + +* ssh +* [GitHub cli][gh-cli] +* git +* optional (dependent the features you are using) + * [git lfs][git-lfs] if you are using the lfs functionality + * [yq][yq] if you are using the hook functionality + * gpg if you are using the git signing functionality + +Furthermore most likely you have a custom domain name. Therefore you should configure the `hostname` GitHub action parameter. + +### Remark + +:whale: There is also a docker image available which has all needed tools installed. This is helpful e.g. if you are not able to use a remote action. +The idea is to use the [docker action][action-docker] + +* [GitHub registry][github-repo] +* [Dockerhub registry][dockerhub-repo] + ## Troubleshooting * refusing to allow a GitHub App to create or update workflow `.github/workflows/******.yml` without `workflows` permission @@ -721,6 +752,8 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d