Skip to content

Commit

Permalink
fixed bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
sarem-h committed Jun 9, 2024
1 parent 63f7fd6 commit 5fb90ec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
11 changes: 4 additions & 7 deletions .github/workflows/preview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:

- name: Get Git Commit Hash
id: commit_hash
run: echo "::set-output name=commit_hash::$(git rev-parse HEAD)"
run: echo "COMMIT_HASH=$(git rev-parse HEAD)" >> $GITHUB_ENV

- name: Find PR number
id: pr
Expand All @@ -49,16 +49,13 @@ jobs:
return pullRequestNumber
- name: Inject Git Commit Hash
run: sed -i "s/REACT_APP_GIT_COMMIT_HASH/${{ steps.commit_hash.outputs.commit_hash }}/g" ./src/components/AppHeader/AccountMenu.jsx

- name: Set React Environment Variable
run: echo "REACT_APP_GIT_COMMIT_HASH=${{ steps.commit_hash.outputs.commit_hash }}" >> $GITHUB_ENV
run: sed -i "s/REACT_APP_GIT_COMMIT_HASH_PLACEHOLDER/${{ env.COMMIT_HASH }}/g" ./src/components/AppHeader/AccountMenu.jsx

- name: Deploy to Cloudflare Pages
id: cloudflare-publish
uses: cloudflare/[email protected]
with:
branch: ${{ steps.pr.outputs.result }}
branch: ${{ github.head_ref }}
projectName: connect
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
apiToken: ${{ secrets.CLOUDFLARE_PAGES_TOKEN }}
Expand All @@ -74,7 +71,7 @@ jobs:
* mark your PR as a draft until it's ready to review
* post the preview on [Discord](https://discord.comma.ai); feedback from users will speed up the PR review
Deployed preview: https://${{ steps.pr.outputs.result }}.connect-d5y.pages.dev (Commit: ${{ steps.commit_hash.outputs.commit_hash }})
Deployed preview: https://${{ steps.pr.outputs.result }}.connect-d5y.pages.dev (Commit: ${{ env.COMMIT_HASH }})
comment_tag: run_id
pr_number: ${{ steps.pr.outputs.result }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions src/components/AppHeader/AccountMenu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const AccountMenu = ({ profile, open, anchorEl, onClose, ...rest }) => {

const shortenGitHash = fullHash => fullHash ? fullHash.substring(0, 7) : '';

const gitCommitHash = process.env.REACT_APP_GIT_COMMIT_HASH || '';
const gitCommitHash = process.env.REACT_APP_GIT_COMMIT_HASH_PLACEHOLDER || '';
const shortGitCommitHash = shortenGitHash(gitCommitHash);
const gitCommitUrl = gitCommitHash ? `https://github.com/commaai/openpilot/commit/${shortGitCommitHash}` : '';

Expand Down Expand Up @@ -63,4 +63,4 @@ const AccountMenu = ({ profile, open, anchorEl, onClose, ...rest }) => {
);
};

export default AccountMenu;
export default AccountMenu;

0 comments on commit 5fb90ec

Please sign in to comment.