Skip to content

Commit

Permalink
New approach.
Browse files Browse the repository at this point in the history
  • Loading branch information
okamsn committed Feb 25, 2024
1 parent af43495 commit a300cde
Showing 1 changed file with 103 additions and 67 deletions.
170 changes: 103 additions & 67 deletions .github/workflows/automatic-pr-to-dash-copy.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,4 @@
# name: Push commit
# on: push
# permissions:
# contents: write
# jobs:
# report:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - name: Create report file
# run: date +%s > report.txt
# - name: Commit report
# run: |
# git config --global user.name 'Github Action'
# git config --global user.email '<>'
# git switch loopy-dash-only
# git diff <branch>^..<branch> -- <filename> | git apply
# git push


name: Automatic push to loopy-dash copy
name: Copy loopy-dash
on:
push:
branches:
Expand All @@ -28,57 +8,113 @@ on:
branches:
- main
- master

jobs:
auto-push:
name: 'Push copy of this repo to loopy-dash repo.'
permissions:
pull-requests: write
contents: write
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v3
with:
ref: master
# path: "${{ github.workspace }}/loopy"
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
- name: List files in the repository
path: loopy
- uses: actions/checkout@v3
with:
repository: okamsn/loopy-dash
path: loopy-dash
token: ${{secrets.CP_DASH_TOKEN}}
- name: Copy file
run: |
ls ${{ github.workspace }}
- run: |
git branch -C loopy-dash-only gha-auto-pr
git checkout master -- loopy-dash.el
git add loopy-dash.el
git config user.name 'Github Action'
git config user.email '<>'
git commit -m 'Auto commit.'
gh pr create --base loopy-dash-only \
--title 'Automatic PR.' --body 'Automatic PR from GitHub Actions.'
cp loopy/loopy-dash.el loopy-dash/loopy-dash.el
cd loopy-dash
git config --local user.name "github-actions[bot]"
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add --force loopy-dash.el
git commit -m "Automatic PR test"
git push https://$USERNAME:[email protected]/okamsn/loopy-dash.git
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - run: |
# # git clone 'https://github.com/okamsn/loopy-dash.git' loopy-dash
# # git clone 'https://github.com/okamsn/loopy.git' loopy
# # cp loopy/loopy-dash.el loopy-dash/loopy-dash.el
REPO_KEY: ${{secrets.PUSH_TOKEN}}
USERNAME: github-actions[bot]

# # name: Push commit
# # on: push
# # permissions:
# # contents: write
# # jobs:
# # report:
# # runs-on: ubuntu-latest
# # steps:
# # - uses: actions/checkout@v3
# # - name: Create report file
# # run: date +%s > report.txt
# # - name: Commit report
# # run: |
# # git config --global user.name 'Github Action'
# # git config --global user.email '<>'
# # git switch loopy-dash-only
# # git diff <branch>^..<branch> -- <filename> | git apply
# # git push
#
#
# # git push
# # git clone 'https://github.com/okamsn/loopy-dash.git' "${{ github.workspace }}/loopy-dash"
# # cp "${{ github.workspace }}/loopy/loopy-dash.el" "${{ github.workspace }}/loopy-dash/loopy-dash.el"
# # cd "${{ github.workspace }}/loopy-dash"
# # git config user.name 'GitHub Actions'
# # git config user.email '<>'
# # git switch main
# # git add --force loopy-dash.el
# # git commit -m 'Automatic commit.'
# # # - run: git show-ref
# # # - run: git switch master
# # # - run: git push 'https://github.com/okamsn/loopy-dash.git' full-main
# # - uses: actions/checkout@v4
# # with:
# # ref: master
# # path: loopy-dash
# # - run: cp "${{ github.workspace }}/loopy/loopy-dash.el" "${{github.workspace }}/loopy-dash/loopy-dash.el"
# # - run: cd "${{github.workspace }}/loopy-dash"
# # - run: ls -a
# name: Automatic push to loopy-dash copy
# on:
# push:
# branches:
# - main
# - master
# pull_request:
# branches:
# - main
# - master
# jobs:
# auto-push:
# name: 'Push copy of this repo to loopy-dash repo.'
# permissions:
# pull-requests: write
# contents: write
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# with:
# ref: master
# # path: "${{ github.workspace }}/loopy"
# - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
# - run: echo "🖥️ The workflow is now ready to test your code on the runner."
# - name: List files in the repository
# run: |
# ls ${{ github.workspace }}
# - run: |
# git branch -C loopy-dash-only gha-auto-pr
# git checkout master -- loopy-dash.el
# git add loopy-dash.el
# git config user.name 'Github Action'
# git config user.email '<>'
# git commit -m 'Auto commit.'
# gh pr create --base loopy-dash-only \
# --title 'Automatic PR.' --body 'Automatic PR from GitHub Actions.'
# env:
# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# # - run: |
# # # git clone 'https://github.com/okamsn/loopy-dash.git' loopy-dash
# # # git clone 'https://github.com/okamsn/loopy.git' loopy
# # # cp loopy/loopy-dash.el loopy-dash/loopy-dash.el
# #
# #
# # # git push
# # # git clone 'https://github.com/okamsn/loopy-dash.git' "${{ github.workspace }}/loopy-dash"
# # # cp "${{ github.workspace }}/loopy/loopy-dash.el" "${{ github.workspace }}/loopy-dash/loopy-dash.el"
# # # cd "${{ github.workspace }}/loopy-dash"
# # # git config user.name 'GitHub Actions'
# # # git config user.email '<>'
# # # git switch main
# # # git add --force loopy-dash.el
# # # git commit -m 'Automatic commit.'
# # # # - run: git show-ref
# # # # - run: git switch master
# # # # - run: git push 'https://github.com/okamsn/loopy-dash.git' full-main
# # # - uses: actions/checkout@v4
# # # with:
# # # ref: master
# # # path: loopy-dash
# # # - run: cp "${{ github.workspace }}/loopy/loopy-dash.el" "${{github.workspace }}/loopy-dash/loopy-dash.el"
# # # - run: cd "${{github.workspace }}/loopy-dash"
# # # - run: ls -a

0 comments on commit a300cde

Please sign in to comment.