Skip to content

.github/workflows/floorp-sync.yml #2704

.github/workflows/floorp-sync.yml

.github/workflows/floorp-sync.yml #2704

Workflow file for this run

# Controls when the workflow will run
on:
# Run on commit
push:
# Triggers the workflow daily
schedule:
- cron: '*/30 * * * *'
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
with:
ref: 'main'
- name: Set commit author
run: |
git config --local user.name "Updater"
git config --local user.email "[email protected]"
- name: Update floorp.spec
run: |
pwd
FLOORP_VER_ORIGINAL=$(curl -s https://api.github.com/repos/Floorp-Projects/Floorp/releases | jq -r 'first(.[].tag_name | select(test("^v[0-9]")))')
FLOORP_VER=$(echo $FLOORP_VER_ORIGINAL | cut -d 'v' -f 2)
sed -i '0,/Version:.*/s//Version: '$FLOORP_VER'/' /home/runner/work/copr/copr/floorp/floorp.spec
- name: Push updated version to the repository
id: github-push
run: |
git config pull.rebase true
git add .
git diff-index --quiet HEAD || git commit -m "chore(floorp): Sync Floorp version"
git push