Repository navigation
feat: port action from Node to Go and decouple image tags #312
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,17 +1,15 @@ | ||
| node_modules | ||
| tests | ||
| coverage | ||
| .github | ||
| .git | ||
| .github | ||
| Dockerfile | ||
| .nvmrc | ||
| jest.config.js | ||
| *.pem | ||
| credentials.json | ||
| .dockerignore | ||
| .gitignore | ||
| .env.example | ||
| .env | ||
| .eslintrc.js | ||
| .prettierrc.js | ||
| *.pem | ||
| credentials.json | ||
| action.yml | ||
| README.md | ||
| LICENSE | ||
| SECURITY.md | ||
| renovate.json | ||
| coverage.out |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,15 @@ | ||
| GOOGLE_EMAIL_ADDRESS=hello@example.com | ||
| GOOGLE_CREDENTIALS=ewogICJ0eXBlIjogInNlcnZpY2VfYWNjb3VudCIsCiAgInByb2plY3RfaWQiOiAibXlwcm9qZWN0IiwKICAicHJpdmF0ZV9rZXlfaWQiOiAicHJpdmF0ZWtleWlkZ29lc2hlcmUiLAogICJwcml2YXRlX2tleSI6ICItLS0tLUJFR0lOIFBSSVZBVEUgS0VZLS0tLS1cbnByaXZhdGVrZXlnb2VzaGVyZVxuLS0tLS1FTkQgUFJJVkFURSBLRVktLS0tLVxuIiwKICAiY2xpZW50X2VtYWlsIjogImdpdGh1YnVzZXJtYW5hZ2VyQGdpdGh1YnVzZXJtYW5hZ2VyLmlhbS5nc2VydmljZWFjY291bnQuY29tIiwKICAiY2xpZW50X2lkIjogImNsaWVudGlkIiwKICAiYXV0aF91cmkiOiAiaHR0cHM6Ly9hY2NvdW50cy5nb29nbGUuY29tL28vb2F1dGgyL2F1dGgiLAogICJ0b2tlbl91cmkiOiAiaHR0cHM6Ly9vYXV0aDIuZ29vZ2xlYXBpcy5jb20vdG9rZW4iLAogICJhdXRoX3Byb3ZpZGVyX3g1MDlfY2VydF91cmwiOiAiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vb2F1dGgyL3YxL2NlcnRzIiwKICAiY2xpZW50X3g1MDlfY2VydF91cmwiOiAiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vcm9ib3QvdjEvbWV0YWRhdGEveDUwOS9naXRodWJ1c2VybWFuYWdlciU0MGdpdGh1YnVzZXJtYW5hZ2VyLmlhbS5nc2VydmljZWFjY291bnQuY29tIgp9Cg== | ||
| ADD_USERS=TRUE | ||
| REMOVE_USERS=TRUE | ||
| EXIT_CODE_ON_MISMATCH=0 | ||
| GITHUB_ORG=myorg | ||
| GITHUB_INSTALLATION_ID=123 | ||
| GITHUB_APP_ID=123 | ||
| GITHUB_PRIVATE_KEY=LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0tXG5wcml2YXRla2V5Z29lc2hlcmVcbi0tLS0tRU5EIFBSSVZBVEUgS0VZLS0tLS1cbg== | ||
| IGNORED_USERS=user1,user2 | ||
| SYNC_TEAM=TRUE | ||
| GITHUB_TEAM_SLUG=remarkable | ||
| # Inputs are read as GitHub Action inputs, exposed to the container as INPUT_* | ||
| # environment variables (upper-cased input name). Set these when running the | ||
| # container directly, e.g. `docker run --env-file .env githubusermanager`. | ||
| INPUT_GOOGLE-EMAIL-ADDRESS=hello@example.com | ||
| INPUT_GOOGLE-CREDENTIALS=ewogICJ0eXBlIjogInNlcnZpY2VfYWNjb3VudCIsCiAgInByb2plY3RfaWQiOiAibXlwcm9qZWN0IiwKICAicHJpdmF0ZV9rZXlfaWQiOiAicHJpdmF0ZWtleWlkZ29lc2hlcmUiLAogICJwcml2YXRlX2tleSI6ICItLS0tLUJFR0lOIFBSSVZBVEUgS0VZLS0tLS1cbnByaXZhdGVrZXlnb2VzaGVyZVxuLS0tLS1FTkQgUFJJVkFURSBLRVktLS0tLVxuIiwKICAiY2xpZW50X2VtYWlsIjogImdpdGh1YnVzZXJtYW5hZ2VyQGdpdGh1YnVzZXJtYW5hZ2VyLmlhbS5nc2VydmljZWFjY291bnQuY29tIiwKICAiY2xpZW50X2lkIjogImNsaWVudGlkIiwKICAiYXV0aF91cmkiOiAiaHR0cHM6Ly9hY2NvdW50cy5nb29nbGUuY29tL28vb2F1dGgyL2F1dGgiLAogICJ0b2tlbl91cmkiOiAiaHR0cHM6Ly9vYXV0aDIuZ29vZ2xlYXBpcy5jb20vdG9rZW4iLAogICJhdXRoX3Byb3ZpZGVyX3g1MDlfY2VydF91cmwiOiAiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vb2F1dGgyL3YxL2NlcnRzIiwKICAiY2xpZW50X3g1MDlfY2VydF91cmwiOiAiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vcm9ib3QvdjEvbWV0YWRhdGEveDUwOS9naXRodWJ1c2VybWFuYWdlciU0MGdpdGh1YnVzZXJtYW5hZ2VyLmlhbS5nc2VydmljZWFjY291bnQuY29tIgp9Cg== | ||
| INPUT_ADD-USERS=TRUE | ||
| INPUT_REMOVE-USERS=TRUE | ||
| INPUT_EXIT-CODE-ON-MISMATCH=0 | ||
| INPUT_GITHUB-ORG=myorg | ||
| INPUT_GITHUB-INSTALLATION-ID=123 | ||
| INPUT_GITHUB-APP-ID=123 | ||
| INPUT_GITHUB-PRIVATE-KEY=LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0tXG5wcml2YXRla2V5Z29lc2hlcmVcbi0tLS0tRU5EIFBSSVZBVEUgS0VZLS0tLS1cbg== | ||
| INPUT_IGNORED-USERS=user1,user2 | ||
| INPUT_SYNC-TEAM=TRUE | ||
| INPUT_TEAM-SLUG=remarkable |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| name: release | ||
|
|
||
| # When a release is published for a semver tag (vX.Y.Z), move the matching | ||
| # major (vX) and major.minor (vX.Y) git tags to the released commit. This keeps | ||
| # `uses: reMarkable/githubUserManager@v1` (and @v1.2) pointing at the latest | ||
| # compatible release. The action is a Docker container action built from the | ||
| # Dockerfile at the referenced commit, so these git tags are the only thing | ||
| # consumers pin against. | ||
| on: | ||
| release: | ||
| types: | ||
| - published | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| jobs: | ||
| move-major-minor-tags: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Move major and major.minor tags | ||
| env: | ||
| RELEASE_TAG: ${{ github.event.release.tag_name }} | ||
| RELEASE_SHA: ${{ github.event.release.target_commitish }} | ||
| run: | | ||
| set -euo pipefail | ||
|
|
||
| if [[ ! "$RELEASE_TAG" =~ ^v([0-9]+)\.([0-9]+)\.([0-9]+)$ ]]; then | ||
| echo "Release tag '$RELEASE_TAG' is not a vX.Y.Z semver tag; skipping." | ||
| exit 0 | ||
| fi | ||
|
|
||
| major="v${BASH_REMATCH[1]}" | ||
| minor="v${BASH_REMATCH[1]}.${BASH_REMATCH[2]}" | ||
|
|
||
| # Resolve the commit the release points at (the annotated release tag). | ||
| target="$(git rev-list -n 1 "$RELEASE_TAG")" | ||
| echo "Release $RELEASE_TAG -> $target; moving $major and $minor" | ||
|
|
||
| git config user.name "github-actions[bot]" | ||
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
|
|
||
| for tag in "$major" "$minor"; do | ||
| git tag -f "$tag" "$target" | ||
| git push --force origin "refs/tags/$tag" | ||
| done | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| credentials.json | ||
| node_modules | ||
| .env | ||
| coverage | ||
| *.pem | ||
| coverage.out | ||
| *.pem | ||
| /githubusermanager |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| # See https://pre-commit.com for more information | ||
| # See https://pre-commit.com/hooks.html for more hooks | ||
| default_install_hook_types: [pre-commit, commit-msg] | ||
| repos: | ||
| - repo: https://github.com/python-jsonschema/check-jsonschema | ||
| rev: 0.38.2 | ||
| hooks: | ||
| - id: check-github-workflows | ||
| - id: check-renovate | ||
| - repo: builtin | ||
| hooks: | ||
| - id: trailing-whitespace | ||
| - id: end-of-file-fixer | ||
| - repo: https://github.com/antonbabenko/pre-commit-terraform | ||
| rev: v1.109.2 | ||
| hooks: | ||
| - id: terraform_fmt | ||
| - id: terraform_tflint | ||
| - repo: https://github.com/compilerla/conventional-pre-commit | ||
| rev: v4.4.0 | ||
| hooks: | ||
| - id: conventional-pre-commit | ||
| stages: [commit-msg] | ||
| args: [feat, fix, docs, perf, refactor, test, security, chore] | ||
| - repo: https://github.com/hadolint/hadolint | ||
| rev: v2.15.1 | ||
| hooks: | ||
| - id: hadolint | ||
| - repo: 'https://github.com/golangci/golangci-lint' | ||
| rev: v2.15.0 | ||
| hooks: | ||
| - id: golangci-lint-full | ||
| - id: golangci-lint-fmt | ||
| - id: golangci-lint-config-verify |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,12 @@ | ||
| FROM node:24.18.1-alpine@sha256:f70403e87646dc51b45295f4b8b70cdad0b63d2297c4c9899119b03f7af7a6b3 | ||
| # syntax=docker/dockerfile:1 | ||
| FROM golang:1.27-alpine AS build | ||
|
|
||
| WORKDIR /app | ||
| RUN corepack enable && echo yo | ||
| COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./ | ||
| RUN pnpm install --production --frozen-lockfile | ||
| WORKDIR /src | ||
| COPY go.mod go.sum ./ | ||
| RUN go mod download | ||
| COPY . . | ||
| RUN CGO_ENABLED=0 GOFLAGS=-trimpath go build -ldflags="-s -w" -o /githubusermanager . | ||
|
|
||
| CMD ["pnpm", "start"] | ||
| FROM gcr.io/distroless/static-debian13:nonroot | ||
| COPY --from=build /githubusermanager /githubusermanager | ||
| ENTRYPOINT ["/githubusermanager"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should drop the mutable tags completely. I've seen many do the same recently.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, I'm working towards trying to make releasing this less of a pain, and doing that works against that. :-/