fix: share url instrumentation #533
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Branch Release (Bookmarklet) | |
on: push | |
jobs: | |
branch-release: | |
runs-on: ubuntu-latest | |
if: "${{ !endsWith(github.ref, '/main') && !contains(github.ref, '/renovate-') && !contains(github.event.head_commit.message, '[skip ci]') }}" | |
steps: | |
- name: Checkout source repo | |
uses: actions/checkout@v3 | |
with: | |
ssh-key: ${{ secrets.SSH-KEY }} | |
- name: Checkout target repo | |
uses: actions/checkout@v3 | |
with: | |
repository: adobe/helix-website | |
token: ${{ secrets.PAT }} | |
fetch-depth: 0 | |
clean: true | |
path: _target | |
- name: Copy changes from source to target repo and create branch commit | |
run: | | |
cd _target | |
# generate target branch name | |
IFS='/' read -ra temp <<< "${{ github.ref }}" | |
targetbranch=sidekick-${temp[2]} | |
# create and/or switch to target branch and apply changes | |
git switch ${targetbranch} || git checkout -b ${targetbranch} | |
cp ../src/bookmarklet/app.js tools/sidekick/ | |
cp ../src/extension/module.js tools/sidekick/ | |
cp ../src/extension/app.css tools/sidekick/ | |
cp -r ../src/extension/_locales tools/sidekick/ | |
cp -r ../src/extension/view tools/sidekick/ | |
cp ../docs/config.schema.json tools/sidekick/ | |
mkdir -p tools/sidekick/lib | |
cp ../src/extension/lib/process-queue.js tools/sidekick/lib/ | |
git add tools/sidekick/* | |
if [ "`git status -s`" != "" ]; then | |
echo Changes: `git status -s` | |
# push changes to target branch | |
git config user.name ${{ github.actor }} | |
git config user.email ${{ github.actor }}@users.noreply.github.com | |
git config user.password ${{ secrets.PAT }} | |
git commit -m"chore(sidekick): branch release [skip ci]" | |
git push origin ${targetbranch} | |
else | |
echo No changes to commit | |
fi |