|
1 | 1 | # digestabotctl |
2 | 2 |
|
3 | | -## Docs are [here](./docs) |
| 3 | +Updates image digests in files. |
| 4 | + |
| 5 | +## GitHub |
| 6 | + |
| 7 | +``` |
| 8 | +jobs: |
| 9 | + digestabot: |
| 10 | + name: Digestabot |
| 11 | + runs-on: ubuntu-latest |
| 12 | +
|
| 13 | + permissions: |
| 14 | + contents: write |
| 15 | + pull-requests: write |
| 16 | + id-token: write |
| 17 | +
|
| 18 | + steps: |
| 19 | + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 20 | + - uses: chainguard-dev/setup-chainctl@v0.3.2 |
| 21 | + with: |
| 22 | + identity: '<your-assumable-id>' |
| 23 | +
|
| 24 | + - name: digestabot |
| 25 | + env: |
| 26 | + DIGESTABOT_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 27 | + DIGESTABOT_BRANCH: digestabot-update # branch to push commits to |
| 28 | + DIGESTABOT_CREATE_PR: true |
| 29 | + DIGESTABOT_PLATFORM: github |
| 30 | + DIGESTABOT_OWNER: org-owner |
| 31 | + DIGESTABOT_REPO: repo-name |
| 32 | + DIGESTABOT_SIGN: true # set to true if you want to sign commits with sigstore |
| 33 | + DIGESTABOT_EMAIL: committer email |
| 34 | + DIGESTABOT_NAME: committer username |
| 35 | + run: | |
| 36 | + ./digestabotctl update files |
| 37 | +``` |
| 38 | + |
| 39 | +## GitLab |
| 40 | + |
| 41 | +``` |
| 42 | +stages: |
| 43 | + - update |
| 44 | +workflow: |
| 45 | + rules: |
| 46 | + - if: $CI_PIPELINE_SOURCE == "web" || $CI_PIPELINE_SOURCE == "schedule" |
| 47 | +variables: |
| 48 | + DIGESTABOT_TOKEN: ${PUSH_TOKEN} |
| 49 | + DIGESTABOT_BRANCH: digestabot-update # branch to push commits to |
| 50 | + DIGESTABOT_CREATE_PR: true |
| 51 | + DIGESTABOT_PLATFORM: gitlab |
| 52 | + DIGESTABOT_OWNER: $CI_PROJECT_NAMESPACE |
| 53 | + DIGESTABOT_REPO: $CI_PROJECT_ID |
| 54 | + DIGESTABOT_SIGN: true |
| 55 | + DIGESTABOT_SIGNING_TOKEN: $SIGSTORE_TOKEN # needed for GitLab since it's not an API exchange |
| 56 | + DIGESTABOT_EMAIL: $GITLAB_USER_EMAIL |
| 57 | + DIGESTABOT_NAME: $GITLAB_USER_NAME |
| 58 | +
|
| 59 | +digestabot: |
| 60 | + stage: update |
| 61 | + id_tokens: |
| 62 | + ID_TOKEN_1: |
| 63 | + aud: https://gitlab.com |
| 64 | + SIGSTORE_TOKEN: |
| 65 | + aud: sigstore # get token with audience for commit signing |
| 66 | + script: |
| 67 | + - wget -O /bin/chainctl "https://dl.enforce.dev/chainctl/latest/chainctl_linux_$(uname -m)" |
| 68 | + - chmod 755 /bin/chainctl |
| 69 | + - chainctl auth login --identity-token $ID_TOKEN_1 --identity $CGR_IDENTITY --audience apk.cgr.dev |
| 70 | + - chainctl auth configure-docker --identity-token $ID_TOKEN_1 --identity $CGR_IDENTITY |
| 71 | + - digestabotctl update files |
| 72 | +
|
| 73 | +``` |
| 74 | + |
| 75 | + |
| 76 | +## CLI Reference is [here](./docs) |
0 commit comments