Skip to content

Merge pull request #54 from Heistergand/Heistergand-patch-1 #10

Merge pull request #54 from Heistergand/Heistergand-patch-1

Merge pull request #54 from Heistergand/Heistergand-patch-1 #10

Workflow file for this run

name: Deploy Userscript
on:
push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set URL for master branch
if: github.ref == 'refs/heads/master'
run: |
BRANCH_NAME=${GITHUB_REF#refs/heads/}
sed -i 's|https://github.com/Heistergand/fanfields2/raw/beta/|https://github.com/Heistergand/fanfields2/raw/${BRANCH_NAME}/|g' iitc_plugin_fanfields2.user.js iitc_plugin_fanfields2.meta.js
sed -i 's|https://raw.githubusercontent.com/Heistergand/fanfields2/beta/|https://raw.githubusercontent.com/Heistergand/fanfields2/${BRANCH_NAME}/|g' iitc_plugin_fanfields2.user.js iitc_plugin_fanfields2.meta.js
if [[ "$BRANCH_NAME" == "master" ]]; then
sed -i "s|IITC plugin: Fan Fields 2 (beta)|IITC plugin: Fan Fields 2|" iitc_plugin_fanfields2.user.js iitc_plugin_fanfields2.meta.js
fi
sed -E -i "s/^\/\/\s*@version\s+(\d+)\.(\d+)\.(\d+)\.(\d+)/\1.\2.\3/" iitc_plugin_fanfields2.user.js iitc_plugin_fanfields2.meta.js
- name: Commit and push changes
run: |
git config --local user.email "${{ github.actor }}@users.noreply.github.com"
git config --local user.name "${{ github.actor }}"
git add .
git commit -m "Update files from GitHub Action"
git push