Skip to content

Commit

Permalink
fix: v2 update ci (#9)
Browse files Browse the repository at this point in the history
Co-authored-by: Robert Duncan <[email protected]>
  • Loading branch information
robproject and Robert Duncan authored Mar 16, 2024
1 parent ac998c2 commit 4461a74
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 21 deletions.
14 changes: 4 additions & 10 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
name: Diff Sample
on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]

branches: [main]

jobs:
Diff:
Expand All @@ -23,7 +22,7 @@ jobs:
chmod +x ./frappe_schema_json_diff.py
echo "GIT_EXTERNAL_DIFF=./frappe_schema_json_diff.py" >> $GITHUB_ENV
echo "TABLE_MODE=1" >> $GITHUB_ENV
- name: Diff
run: |
git --no-pager diff HEAD~1 HEAD > diff_output.txt
Expand All @@ -35,7 +34,7 @@ jobs:
pip install ansi2html
cat diff_output.txt | ansi2html > diff_output.html
sed -i -n '/<pre class="ansi2html-content">/,/<\/pre>/p' diff_output.html
- name: Post comment
if: github.event_name == 'pull_request'
uses: actions/github-script@v6
Expand All @@ -57,8 +56,3 @@ jobs:
issue_number: issue_number,
body: output,
});
26 changes: 17 additions & 9 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@

name: Release
on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]

env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
branches: [main]

jobs:
Release:
permissions:
contents: write
issues: write
pull-requests: write
name: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Release
run: npx semantic-release
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
cache: npm
node-version: lts/*
- run: npm clean-install
- run: corepack npm audit signatures
- run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions frappe_schema_json_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,8 @@ def get_common_key(self, name: str, dict_list: list) -> True:
"custom_perms": "role",
"permissions": "role",
}
if (common_key := common_keys.get(name)) is not None:
return common_key
if (key := common_keys.get(name)) is not None:
return key
else:
# Find common keys then return the first one with all unique values.
# https://stackoverflow.com/a/13985856/14410691
Expand Down

0 comments on commit 4461a74

Please sign in to comment.