Update formulas #62
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: Test Formulae Update | |
on: | |
pull_request: | |
types: [opened, synchronize, reopened] | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
test-formulae: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.1' | |
- name: Install dependencies | |
run: | | |
gem install nokogiri | |
gem install rubocop | |
gem install bundler-audit | |
bundle install | |
- name: Configure Git | |
env: | |
GH_PAT: ${{ secrets.GH_PAT }} | |
run: | | |
git config --global user.name 'yakdriverbot' | |
git config --global user.email 'f1formula.juan@gmail.com' | |
git config --global pull.rebase true | |
git remote set-url origin https://$GH_PAT@github.com/YakDriver/homebrew-tap.git | |
git pull origin ${{ github.head_ref }} | |
- name: RuboCop Auto-correct | |
run: | | |
rubocop --autocorrect | |
- name: Commit RuboCop fixes | |
run: | | |
if [ -n "$(git status --porcelain)" ]; then | |
git add . | |
git commit -m "Apply RuboCop auto-correct fixes" | |
echo "Pushing changes to ${{ github.head_ref }}" | |
git push origin HEAD:${{ github.head_ref }} | |
else | |
echo "No changes to commit" | |
fi | |
- name: RuboCop check | |
run: | | |
rubocop | |
- name: Run Bundler Audit | |
run: | | |
bundle exec bundler-audit check --update | |
- name: Run update script | |
run: | | |
ruby update.rb | |
- name: Read update summary | |
id: read_summary | |
run: | | |
echo "UPDATE_SUMMARY<<EOF" >> $GITHUB_ENV | |
cat update_summary.txt >> $GITHUB_ENV | |
echo "EOF" >> $GITHUB_ENV | |
- name: Verify update summary | |
run: | | |
if [ ! -s update_summary.txt ]; then | |
echo "Update summary is empty" | |
exit 1 | |
fi | |
echo "Update summary is set" |