From 85adb754382511c391a7c3e781efe45876b66e81 Mon Sep 17 00:00:00 2001 From: lubiana Date: Sat, 4 May 2024 19:27:01 +0200 Subject: [PATCH 1/5] add workflow --- .forgejo/workflows/pull_request.yml | 33 +++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .forgejo/workflows/pull_request.yml diff --git a/.forgejo/workflows/pull_request.yml b/.forgejo/workflows/pull_request.yml new file mode 100644 index 0000000..6c4f37c --- /dev/null +++ b/.forgejo/workflows/pull_request.yml @@ -0,0 +1,33 @@ +on: [pull_request] +jobs: + ls: + runs-on: docker + container: + image: git.php.fail/lubiana/container/php:ci + steps: + - name: Manually checkout + env: + REPO: '${{ github.repository }}' + TOKEN: '${{ secrets.GITHUB_TOKEN }}' + GIT_SERVER: 'git.php.fail' + COMPOSER_CACHE_DIR: /opt/hostedtoolcache/.composer/cache/files + run: | + git clone --branch $GITHUB_REF_NAME https://${TOKEN}@${GIT_SERVER}/${REPO}.git . + git fetch + git checkout ${{ github.head_ref }} + - name: create composer cache dir + run: | + mkdir -p /opt/hostedtoolcache/.composer/cache/files + - run: composer install + - run: composer lint + - name: GIT commit and push all changed files + env: + CI_COMMIT_MESSAGE: Continuous Integration Fixes + CI_COMMIT_AUTHOR: Continuous Integration + run: | + if [[ -n "$(git status -s)" ]]; then + git config --global user.name "${{ env.CI_COMMIT_AUTHOR }}" + git config --global user.email "gitbot@users.noreply.php.fail" + git commit -am "${{ env.CI_COMMIT_MESSAGE }}" + git push + fi \ No newline at end of file From 0a042adfcdf05bcff40963972a4dccf7dc73506c Mon Sep 17 00:00:00 2001 From: lubiana Date: Sat, 4 May 2024 19:29:09 +0200 Subject: [PATCH 2/5] test --- .forgejo/workflows/pull_request.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.forgejo/workflows/pull_request.yml b/.forgejo/workflows/pull_request.yml index 6c4f37c..6f771f1 100644 --- a/.forgejo/workflows/pull_request.yml +++ b/.forgejo/workflows/pull_request.yml @@ -5,6 +5,9 @@ jobs: container: image: git.php.fail/lubiana/container/php:ci steps: + - name: env + run: | + env - name: Manually checkout env: REPO: '${{ github.repository }}' From 0cc7768780b27854eb0ffde55d8c616294b407fd Mon Sep 17 00:00:00 2001 From: lubiana Date: Sat, 4 May 2024 19:32:29 +0200 Subject: [PATCH 3/5] test --- .forgejo/workflows/{pull_request.yml => push.yml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename .forgejo/workflows/{pull_request.yml => push.yml} (98%) diff --git a/.forgejo/workflows/pull_request.yml b/.forgejo/workflows/push.yml similarity index 98% rename from .forgejo/workflows/pull_request.yml rename to .forgejo/workflows/push.yml index 6f771f1..041e993 100644 --- a/.forgejo/workflows/pull_request.yml +++ b/.forgejo/workflows/push.yml @@ -1,4 +1,4 @@ -on: [pull_request] +on: [push] jobs: ls: runs-on: docker From 284c2d823cd2bb625cd944ad5d34da71854ded32 Mon Sep 17 00:00:00 2001 From: lubiana Date: Sat, 4 May 2024 19:33:17 +0200 Subject: [PATCH 4/5] test --- .forgejo/workflows/push.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.forgejo/workflows/push.yml b/.forgejo/workflows/push.yml index 041e993..0754eff 100644 --- a/.forgejo/workflows/push.yml +++ b/.forgejo/workflows/push.yml @@ -5,9 +5,6 @@ jobs: container: image: git.php.fail/lubiana/container/php:ci steps: - - name: env - run: | - env - name: Manually checkout env: REPO: '${{ github.repository }}' From 713b047068ce7d17666cd227ab1696eb1289424e Mon Sep 17 00:00:00 2001 From: lubiana Date: Sat, 4 May 2024 19:27:01 +0200 Subject: [PATCH 5/5] add workflow --- .forgejo/workflows/push.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .forgejo/workflows/push.yml diff --git a/.forgejo/workflows/push.yml b/.forgejo/workflows/push.yml new file mode 100644 index 0000000..0754eff --- /dev/null +++ b/.forgejo/workflows/push.yml @@ -0,0 +1,33 @@ +on: [push] +jobs: + ls: + runs-on: docker + container: + image: git.php.fail/lubiana/container/php:ci + steps: + - name: Manually checkout + env: + REPO: '${{ github.repository }}' + TOKEN: '${{ secrets.GITHUB_TOKEN }}' + GIT_SERVER: 'git.php.fail' + COMPOSER_CACHE_DIR: /opt/hostedtoolcache/.composer/cache/files + run: | + git clone --branch $GITHUB_REF_NAME https://${TOKEN}@${GIT_SERVER}/${REPO}.git . + git fetch + git checkout ${{ github.head_ref }} + - name: create composer cache dir + run: | + mkdir -p /opt/hostedtoolcache/.composer/cache/files + - run: composer install + - run: composer lint + - name: GIT commit and push all changed files + env: + CI_COMMIT_MESSAGE: Continuous Integration Fixes + CI_COMMIT_AUTHOR: Continuous Integration + run: | + if [[ -n "$(git status -s)" ]]; then + git config --global user.name "${{ env.CI_COMMIT_AUTHOR }}" + git config --global user.email "gitbot@users.noreply.php.fail" + git commit -am "${{ env.CI_COMMIT_MESSAGE }}" + git push + fi \ No newline at end of file