Skip to content

Commit

Permalink
fix: attribution link (#10365)
Browse files Browse the repository at this point in the history
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

- Update the attribution link to match the current app version.
- The update-attributions workflow was using a low-privilege token for
checking out the repository. The checkout step is what determines which
credentials are used upon push. The later step with git push well fail
with a HTTP 403 response despite having a token declared with write
access, because git push uses the credentials setup during checkout.

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

## **Related issues**

Fixes: [#1829](MetaMask/mobile-planning#1829)

## **Manual testing steps**

1. Go to`Settings` Page.
2. Scroll down and click on `About Metamask`.
3. Click on `Attributions`.
4. You should then be redirected to
https://raw.githubusercontent.com/MetaMask/metamask-mobile/v7.27.0/attribution.txt
(where v7.27.0 is the current Metamask Mobile version)

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**


https://github.com/user-attachments/assets/99acf283-a3df-4332-b8f9-85b622f1a838

<!-- [screenshots/recordings] -->

### **After**


https://github.com/user-attachments/assets/7db6972e-96c7-4689-8c1b-2802704bb886

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
  • Loading branch information
cryptodev-2s authored Jul 24, 2024
1 parent 038bfcc commit ad806d6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/update-attributions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ jobs:
uses: actions/checkout@v4
with:
# Use PAT to ensure that the commit later can trigger status check workflows
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.ACTIONS_WRITE_TOKEN }}
- name: Checkout pull request
run: gh pr checkout "${PR_NUMBER}"
env:
Expand Down Expand Up @@ -144,8 +144,6 @@ jobs:
git config --global user.email 'metamaskbot@users.noreply.github.com'
git commit -am "Update Attributions"
git push
env:
GITHUB_TOKEN: ${{ secrets.ACTIONS_WRITE_TOKEN }}
- name: Post comment
run: |
if [[ $HAS_CHANGES == 'true' ]]
Expand Down
9 changes: 6 additions & 3 deletions app/components/Views/Settings/AppInformation/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ export default class AppInformation extends PureComponent {

state = {
appInfo: '',
appVersion: '',
};

updateNavBar = () => {
Expand All @@ -120,7 +121,10 @@ export default class AppInformation extends PureComponent {
const appName = await getApplicationName();
const appVersion = await getVersion();
const buildNumber = await getBuildNumber();
this.setState({ appInfo: `${appName} v${appVersion} (${buildNumber})` });
this.setState({
appInfo: `${appName} v${appVersion} (${buildNumber})`,
appVersion,
});
};

componentDidUpdate = () => {
Expand Down Expand Up @@ -150,8 +154,7 @@ export default class AppInformation extends PureComponent {
};

onAttributions = () => {
const url =
'https://raw.githubusercontent.com/MetaMask/metamask-mobile/main/attribution.txt';
const url = `https://raw.githubusercontent.com/MetaMask/metamask-mobile/v${this.state.appVersion}/attribution.txt`;
this.goTo(url, strings('app_information.attributions'));
};

Expand Down

0 comments on commit ad806d6

Please sign in to comment.