Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/r3770/App into fix-Expensif…
Browse files Browse the repository at this point in the history
  • Loading branch information
r3770 committed Nov 21, 2023
2 parents b4a00d8 + b3cc8db commit 768cb20
Show file tree
Hide file tree
Showing 184 changed files with 2,934 additions and 2,260 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,11 @@ In order to bundle actions with their dependencies into a single Node.js executa

- When calling your GitHub Action from one of our workflows, you must:
- First call `@actions/checkout`.
- Use the absolute path of the action in GitHub, including the repo name, path, and branch ref, like so:
- Use the relative path of the action in GitHub from the root of this repo, like so:
```yaml
- name: Generate Version
uses: Expensify/App/.github/actions/javascript/bumpVersion@main
uses: ./.github/actions/javascript/bumpVersion
```
Do not try to use a relative path.
- Confusingly, paths in action metadata files (`action.yml`) _must_ use relative paths.

- You can't use any dynamic values or environment variables in a `uses` statement
- In general, it is a best practice to minimize any side-effects of each action. Using atomic ("dumb") actions that have a clear and simple purpose will promote reuse and make it easier to understand the workflows that use them.
8 changes: 4 additions & 4 deletions .github/workflows/cherryPick.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
createNewVersion:
needs: validateActor
if: ${{ fromJSON(needs.validateActor.outputs.IS_DEPLOYER) }}
uses: Expensify/App/.github/workflows/createNewVersion.yml@main
uses: ./.github/workflows/createNewVersion.yml
secrets: inherit

cherryPick:
Expand All @@ -42,15 +42,15 @@ jobs:

- name: Set up git for OSBotify
id: setupGitForOSBotify
uses: Expensify/App/.github/actions/composite/setupGitForOSBotifyApp@8c19d6da4a3d7ce3b15c9cd89a802187d208ecab
uses: ./.github/actions/composite/setupGitForOSBotifyApp
with:
GPG_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }}
OS_BOTIFY_APP_ID: ${{ secrets.OS_BOTIFY_APP_ID }}
OS_BOTIFY_PRIVATE_KEY: ${{ secrets.OS_BOTIFY_PRIVATE_KEY }}

- name: Get previous app version
id: getPreviousVersion
uses: Expensify/App/.github/actions/javascript/getPreviousVersion@main
uses: ./.github/actions/javascript/getPreviousVersion
with:
SEMVER_LEVEL: "PATCH"

Expand All @@ -67,7 +67,7 @@ jobs:
- name: Get merge commit for pull request to CP
id: getCPMergeCommit
uses: Expensify/App/.github/actions/javascript/getPullRequestDetails@main
uses: ./.github/actions/javascript/getPullRequestDetails
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
USER: ${{ github.actor }}
Expand Down
10 changes: 1 addition & 9 deletions .github/workflows/createDeployChecklist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,7 @@ jobs:
- name: Setup Node
uses: ./.github/actions/composite/setupNode

- name: Set up git for OSBotify
id: setupGitForOSBotify
uses: ./.github/actions/composite/setupGitForOSBotifyApp
with:
GPG_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }}
OS_BOTIFY_APP_ID: ${{ secrets.OS_BOTIFY_APP_ID }}
OS_BOTIFY_PRIVATE_KEY: ${{ secrets.OS_BOTIFY_PRIVATE_KEY }}

- name: Create or update deploy checklist
uses: ./.github/actions/javascript/createOrUpdateStagingDeploy
with:
GITHUB_TOKEN: ${{ steps.setupGitForOSBotify.outputs.OS_BOTIFY_API_TOKEN }}
GITHUB_TOKEN: ${{ github.token }}
6 changes: 3 additions & 3 deletions .github/workflows/createNewVersion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
token: ${{ secrets.OS_BOTIFY_COMMIT_TOKEN }}

- name: Setup git for OSBotify
uses: Expensify/App/.github/actions/composite/setupGitForOSBotifyApp@8c19d6da4a3d7ce3b15c9cd89a802187d208ecab
uses: ./.github/actions/composite/setupGitForOSBotifyApp
id: setupGitForOSBotify
with:
GPG_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }}
Expand All @@ -85,7 +85,7 @@ jobs:

- name: Generate version
id: bumpVersion
uses: Expensify/App/.github/actions/javascript/bumpVersion@main
uses: ./.github/actions/javascript/bumpVersion
with:
GITHUB_TOKEN: ${{ steps.setupGitForOSBotify.outputs.OS_BOTIFY_API_TOKEN }}
SEMVER_LEVEL: ${{ inputs.SEMVER_LEVEL }}
Expand All @@ -105,6 +105,6 @@ jobs:

- name: Announce failed workflow in Slack
if: ${{ failure() }}
uses: Expensify/App/.github/actions/composite/announceFailedWorkflowInSlack@main
uses: ./.github/actions/composite/announceFailedWorkflowInSlack
with:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
8 changes: 4 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
ref: staging
token: ${{ secrets.OS_BOTIFY_TOKEN }}

- uses: Expensify/App/.github/actions/composite/setupGitForOSBotifyApp@8c19d6da4a3d7ce3b15c9cd89a802187d208ecab
- uses: ./.github/actions/composite/setupGitForOSBotifyApp
id: setupGitForOSBotify
with:
GPG_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }}
Expand All @@ -38,7 +38,7 @@ jobs:
ref: production
token: ${{ secrets.OS_BOTIFY_TOKEN }}

- uses: Expensify/App/.github/actions/composite/setupGitForOSBotifyApp@8c19d6da4a3d7ce3b15c9cd89a802187d208ecab
- uses: ./.github/actions/composite/setupGitForOSBotifyApp
id: setupGitForOSBotify
with:
GPG_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }}
Expand All @@ -50,15 +50,15 @@ jobs:

- name: Get Release Pull Request List
id: getReleasePRList
uses: Expensify/App/.github/actions/javascript/getDeployPullRequestList@main
uses: ./.github/actions/javascript/getDeployPullRequestList
with:
TAG: ${{ env.PRODUCTION_VERSION }}
GITHUB_TOKEN: ${{ steps.setupGitForOSBotify.outputs.OS_BOTIFY_API_TOKEN }}
IS_PRODUCTION_DEPLOY: true

- name: Generate Release Body
id: getReleaseBody
uses: Expensify/App/.github/actions/javascript/getReleaseBody@main
uses: ./.github/actions/javascript/getReleaseBody
with:
PR_LIST: ${{ steps.getReleasePRList.outputs.PR_LIST }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deployBlocker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
channel: '#expensify-open-source',
attachments: [{
color: "#DB4545",
text: '💥 We have found a New Expensify Deploy Blocker, if you have any idea which PR could be causing this, please comment in the issue: <${{ github.event.issue.html_url }}|${{ toJSON(github.event.issue.title) }}>',
text: '💥 We have found a New Expensify Deploy Blocker, if you have any idea which PR could be causing this, please comment in the issue: <${{ github.event.issue.html_url }}|${{ github.event.issue.title }}>'.replace(/[&<>"'|]/g, function(m) { return {'&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#039;', '|': '&verbar;'}[m]; }),
}]
}
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deployExpensifyHelp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
uses: actions/checkout@v4

- name: Setup NodeJS
uses: Expensify/App/.github/actions/composite/setupNode@main
uses: ./.github/actions/composite/setupNode

- name: Create docs routes file
run: ./.github/scripts/createDocsRoutes.sh
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/e2ePerformanceTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
- name: Checkout latest main commit (TODO temporary until new version is released)
run: git switch --detach main

- uses: Expensify/App/.github/actions/composite/setupNode@main
- uses: ./.github/actions/composite/setupNode

- uses: ruby/setup-ruby@a05e47355e80e57b9a67566a813648fa67d92011
with:
Expand All @@ -64,7 +64,7 @@ jobs:
- name: Build APK
run: npm run android-build-e2e
shell: bash

- name: Upload APK
uses: actions/upload-artifact@65d862660abb392b8c4a3d1195a2108db131dd05
with:
Expand All @@ -82,7 +82,7 @@ jobs:

- name: Get pull request details
id: getPullRequestDetails
uses: Expensify/App/.github/actions/javascript/getPullRequestDetails@main
uses: ./.github/actions/javascript/getPullRequestDetails
with:
GITHUB_TOKEN: ${{ github.token }}
PULL_REQUEST_NUMBER: ${{ inputs.PR_NUMBER }}
Expand Down Expand Up @@ -136,13 +136,13 @@ jobs:
with:
ruby-version: "2.7"
bundler-cache: true

- uses: gradle/gradle-build-action@3fbe033aaae657f011f88f29be9e65ed26bd29ef

- name: Build APK
run: npm run android-build-e2edelta
shell: bash

- name: Upload APK
uses: actions/upload-artifact@65d862660abb392b8c4a3d1195a2108db131dd05
with:
Expand All @@ -157,7 +157,7 @@ jobs:
- uses: actions/checkout@v4

- name: Setup Node
uses: Expensify/App/.github/actions/composite/setupNode@main
uses: ./.github/actions/composite/setupNode

- name: Make zip directory for everything to send to AWS Device Farm
run: mkdir zip
Expand Down Expand Up @@ -190,7 +190,7 @@ jobs:
run: zip -qr App.zip ./zip

- name: Configure AWS Credentials
uses: Expensify/App/.github/actions/composite/configureAwsCredentials@main
uses: ./.github/actions/composite/configureAwsCredentials
with:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/finishReleaseCycle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
ref: main
token: ${{ secrets.OS_BOTIFY_TOKEN }}

- uses: Expensify/App/.github/actions/composite/setupGitForOSBotifyApp@8c19d6da4a3d7ce3b15c9cd89a802187d208ecab
- uses: ./.github/actions/composite/setupGitForOSBotifyApp
id: setupGitForOSBotify
with:
GPG_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }}
Expand All @@ -38,7 +38,7 @@ jobs:

- name: Reopen and comment on issue (not a team member)
if: ${{ !fromJSON(steps.isDeployer.outputs.IS_DEPLOYER) }}
uses: Expensify/App/.github/actions/javascript/reopenIssueWithComment@main
uses: ./.github/actions/javascript/reopenIssueWithComment
with:
GITHUB_TOKEN: ${{ steps.setupGitForOSBotify.outputs.OS_BOTIFY_API_TOKEN }}
ISSUE_NUMBER: ${{ github.event.issue.number }}
Expand All @@ -49,14 +49,14 @@ jobs:
- name: Check for any deploy blockers
if: ${{ fromJSON(steps.isDeployer.outputs.IS_DEPLOYER) }}
id: checkDeployBlockers
uses: Expensify/App/.github/actions/javascript/checkDeployBlockers@main
uses: ./.github/actions/javascript/checkDeployBlockers
with:
GITHUB_TOKEN: ${{ steps.setupGitForOSBotify.outputs.OS_BOTIFY_API_TOKEN }}
ISSUE_NUMBER: ${{ github.event.issue.number }}

- name: Reopen and comment on issue (has blockers)
if: ${{ fromJSON(steps.isDeployer.outputs.IS_DEPLOYER) && fromJSON(steps.checkDeployBlockers.outputs.HAS_DEPLOY_BLOCKERS || 'false') }}
uses: Expensify/App/.github/actions/javascript/reopenIssueWithComment@main
uses: ./.github/actions/javascript/reopenIssueWithComment
with:
GITHUB_TOKEN: ${{ steps.setupGitForOSBotify.outputs.OS_BOTIFY_API_TOKEN }}
ISSUE_NUMBER: ${{ github.event.issue.number }}
Expand All @@ -66,7 +66,7 @@ jobs:
- name: Announce failed workflow in Slack
if: ${{ failure() }}
uses: Expensify/App/.github/actions/composite/announceFailedWorkflowInSlack@main
uses: ./.github/actions/composite/announceFailedWorkflowInSlack
with:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}

Expand All @@ -84,7 +84,7 @@ jobs:

- name: Setup Git for OSBotify
id: setupGitForOSBotify
uses: Expensify/App/.github/actions/composite/setupGitForOSBotifyApp@8c19d6da4a3d7ce3b15c9cd89a802187d208ecab
uses: ./.github/actions/composite/setupGitForOSBotifyApp
with:
GPG_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }}
OS_BOTIFY_APP_ID: ${{ secrets.OS_BOTIFY_APP_ID }}
Expand All @@ -100,15 +100,15 @@ jobs:
- name: Announce failed workflow in Slack
if: ${{ failure() }}
uses: Expensify/App/.github/actions/composite/announceFailedWorkflowInSlack@main
uses: ./.github/actions/composite/announceFailedWorkflowInSlack
with:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}

# Create a new patch version to prep for next release cycle
createNewPatchVersion:
needs: validate
if: ${{ fromJSON(needs.validate.outputs.isValid) }}
uses: Expensify/App/.github/workflows/createNewVersion.yml@main
uses: ./.github/workflows/createNewVersion.yml
secrets: inherit
with:
SEMVER_LEVEL: PATCH
Expand All @@ -125,7 +125,7 @@ jobs:
token: ${{ secrets.OS_BOTIFY_TOKEN }}

- name: Setup Git for OSBotify
uses: Expensify/App/.github/actions/composite/setupGitForOSBotifyApp@8c19d6da4a3d7ce3b15c9cd89a802187d208ecab
uses: ./.github/actions/composite/setupGitForOSBotifyApp
with:
GPG_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }}
OS_BOTIFY_APP_ID: ${{ secrets.OS_BOTIFY_APP_ID }}
Expand All @@ -141,6 +141,6 @@ jobs:
- name: Announce failed workflow in Slack
if: ${{ failure() }}
uses: Expensify/App/.github/actions/composite/announceFailedWorkflowInSlack@main
uses: ./.github/actions/composite/announceFailedWorkflowInSlack
with:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
uses: actions/checkout@v4

- name: Setup Node
uses: Expensify/App/.github/actions/composite/setupNode@main
uses: ./.github/actions/composite/setupNode

- name: Lint JavaScript and Typescript with ESLint
run: npm run lint
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lockDeploys.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
token: ${{ secrets.OS_BOTIFY_TOKEN }}

- name: Wait for staging deploys to finish
uses: Expensify/App/.github/actions/javascript/awaitStagingDeploys@main
uses: ./.github/actions/javascript/awaitStagingDeploys
with:
GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }}

Expand All @@ -30,6 +30,6 @@ jobs:

- name: Announce failed workflow
if: ${{ failure() }}
uses: Expensify/App/.github/actions/composite/announceFailedWorkflowInSlack@main
uses: ./.github/actions/composite/announceFailedWorkflowInSlack
with:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
Loading

0 comments on commit 768cb20

Please sign in to comment.