Merge pull request #67 from earthly/ido-auto-update-dist-for-renovate

Auto update dist for renovate
This commit is contained in:
idodod 2024-03-26 13:52:59 -04:00 committed by GitHub
commit fcc90668cb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 55 additions and 0 deletions

28
.github/workflows/renovate-helper.yml vendored Normal file
View File

@ -0,0 +1,28 @@
name: Update Renovate Branch
on:
pull_request:
branches: [ main ]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
update-renovate-branch:
if: github.event.pull_request.head.repo.full_name == github.repository && startsWith(github.head_ref, 'renovate/') && github.head_ref == 'renovate[bot]'
runs-on: ubuntu-latest
env:
FORCE_COLOR: 1
EARTHLY_CONVERSION_PARALLELISM: "5"
EARTHLY_TOKEN: "${{ secrets.EARTHLY_TOKEN }}"
EARTHLY_INSTALL_ID: "earthly-actions-setup-githubactions"
steps:
- uses: earthly/actions/setup-earthly@v1
with:
version: v0.8.6
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: Update Branch
run: earthly --ci -P --push +update-dist

View File

@ -7,6 +7,10 @@ on:
- "main"
- "releases/*"
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -1,5 +1,7 @@
VERSION 0.8
PROJECT earthly-technologies/core
npm-base:
FROM node:21.7-alpine3.19
COPY ./package.json ./
@ -93,6 +95,27 @@ lint-newline:
done; \
exit $code
update-dist-for-renovate:
FROM alpine/git
RUN git config --global user.name "renovate[bot]" && \
git config --global user.email "renovate[bot]@users.noreply.github.com" && \
git config --global url."git@github.com:".insteadOf "https://github.com/"
ARG git_repo="earthly/actions-setup"
ARG git_url="git@github.com:$git_repo"
ARG earthly_lib_version=3.0.1
ARG SECRET_PATH=littleredcorvette-id_rsa
DO --pass-args github.com/earthly/lib/utils/git:$earthly_lib_version+DEEP_CLONE \
--GIT_URL=$git_url --SECRET_PATH=$SECRET_PATH
ARG EARTHLY_GIT_BRANCH
LET branch=$EARTHLY_GIT_BRANCH
RUN --mount=type=secret,id=$SECRET_PATH,mode=0400,target=/root/.ssh/id_rsa \
git checkout $branch
COPY --dir +compile/dist .
RUN git add dist && git commit -m "update dist for Renovate" || echo nothing to commit
RUN --push --mount=type=secret,id=$SECRET_PATH,mode=0400,target=/root/.ssh/id_rsa \
git push origin $branch
all:
BUILD +lint