diff --git a/.github/workflows/learn-github-actions.yml b/.github/workflows/learn-github-actions.yml index c807ae1..0a4fffb 100644 --- a/.github/workflows/learn-github-actions.yml +++ b/.github/workflows/learn-github-actions.yml @@ -18,7 +18,8 @@ jobs: helloworld: runs-on: ubuntu-22.04 env: - FOO: bar + TARGET_REPO_NAME: 'hello-octapus-public' + TARGET_REPO: '${{ github.repository_owner }}/hello-octapus-public' steps: - run: git version - run: pwd @@ -41,15 +42,15 @@ jobs: token: ${{ secrets.REPO_READER_ACCESS_TOKEN }} - uses: actions/checkout@v3 with: - repository: '${{ github.repository_owner }}/hello-octapus-public' - path: 'hello-octapus-public' + repository: '${{ env.TARGET_REPO }}' + path: '${{ env.TARGET_REPO_NAME }}' submodules: true token: ${{ secrets.REPO_WRITER_ACCESS_TOKEN }} - run: ls -hal - run: ls -hal working-directory: '${{ github.workspace }}/hello-octapus' - run: ls -hal - working-directory: '${{ github.workspace }}/hello-octapus-public' + working-directory: '${{ github.workspace }}/${{ env.TARGET_REPO_NAME }}' - run: rsync --version - run: >- rsync -avhi --delete --exclude '.gitkeep' ${{ github.workspace }}/hello-octapus/resources/ ${{ github.workspace }}/hello-octapus-public/resources/ @@ -58,9 +59,9 @@ jobs: git remote -v git config user.name '${{ github.actor }}' git config --global user.email '${{ github.actor }}@users.noreply.github.com' - working-directory: '${{ github.workspace }}/hello-octapus-public' + working-directory: '${{ github.workspace }}/${{ env.TARGET_REPO_NAME }}' - run: |- git add resources && git status git commit -am 'Sync `resources/` folder from ${{ github.repository }}' git push origin master - working-directory: '${{ github.workspace }}/hello-octapus-public' + working-directory: '${{ github.workspace }}/${{ env.TARGET_REPO_NAME }}' diff --git a/resources/hello.txt b/resources/hello.txt index e2ffb62..3d40f76 100644 --- a/resources/hello.txt +++ b/resources/hello.txt @@ -1 +1 @@ -Hello (Github Actions) World +Hello (Github Actions) World!!