Skip to content

Commit

Permalink
[FIX] GH Action Permission for Bump-Version (#2961)
Browse files Browse the repository at this point in the history
* updated permissions for gh action

* test bump action

* test bump action

* bump controllers to v14.0.2 (#2952)

* [EIP1559] Improve time estimates (#2955)

* Improve eip1559 time estimates

* Add extendOptions to EditGasFee Components

* Update test

Co-authored-by: Pedro Pablo Aste Kompen <wachunei@gmail.com>

* updated permission and add improvements to slack notification

* removed test workflow

* removed before_run not needed in e2e

* updated bump version script to bump version code everything we push to main or develop

* removed types didn't apply in push

Co-authored-by: ricky <ricky.miller@gmail.com>
Co-authored-by: Andre Pimenta <andrepimenta7@gmail.com>
Co-authored-by: Pedro Pablo Aste Kompen <wachunei@gmail.com>
  • Loading branch information
4 people committed Aug 11, 2021
1 parent 009915e commit bb0c803
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 22 deletions.
14 changes: 5 additions & 9 deletions .github/workflows/bump-version-name.yml
@@ -1,18 +1,14 @@
name: Bump version name
on:
# push:
# branches:
# - develop
pull_request:
push:
branches:
# - develop
# - main
- bitrise_yml_new
types: [opened]
- develop
- main
jobs:
bump-version-name:
runs-on: ubuntu-latest
if: "contains(github.head_ref, 'release/')"
permissions:
contents: write
steps:
- uses: actions/checkout@v2
- name: Bump script
Expand Down
2 changes: 2 additions & 0 deletions bitrise.yml
Expand Up @@ -160,6 +160,8 @@ workflows:
is_always_run: false
# Parallel Build & Deploy Steps
start_release_builds:
before_run:
- setup
steps:
- build-router-start@0:
inputs:
Expand Down
16 changes: 10 additions & 6 deletions scripts/bump-version.sh
Expand Up @@ -12,6 +12,15 @@ MINOR=$(awk -F. '{print $2}' <<< "$versionName")
PATCH=$(awk -F. '{print $3}' <<< "$versionName")
version=$MAJOR'.'$MINOR'.'$PATCH

let "versionNumber+=1"

echo "Bumping versionNumber to"
echo "$versionNumber"

sed -i -e 's/VERSION_NUMBER: [0-9]\{1,\}/VERSION_NUMBER: '"$versionNumber"'/' bitrise.yml

echo "Bumping versionNumber finished"

if [[ $1 == *"release/"* ]] ; then
if [[ $1 == *"-major"* ]] ; then
major=$((MAJOR + 1));
Expand All @@ -27,17 +36,12 @@ if [[ $1 == *"release/"* ]] ; then
version=$MAJOR'.'$MINOR'.'$patch
fi

let "versionNumber+=1"

echo "Bumping versionName to"
echo "$version"

echo "Bumping versionNumber to"
echo "$versionNumber"

sed -i -e 's/VERSION_NUMBER: [0-9]\{1,\}/VERSION_NUMBER: '"$versionNumber"'/' bitrise.yml
sed -i -e 's/VERSION_NAME: [0-9]\{1,\}.[0-9]\{1,\}.[0-9]\{1,\}/VERSION_NAME: '"$version"'/' bitrise.yml
sed -i -e 's/"version": "[0-9]\{1,\}.[0-9]\{1,\}.[0-9]\{1,\}"/"version": "'"$version"'"/' package.json

echo "Bumping versionName & versionNumber finished"
echo "Bumping versionName finished"
fi
20 changes: 13 additions & 7 deletions scripts/metamask-bot-build-announce-bitrise.js
Expand Up @@ -16,20 +16,26 @@ start().catch(console.error);

async function getPRInfo() {
const client = github.client(GITHUB_TOKEN);
const REPO = client.repo(`${BITRISEIO_GIT_REPOSITORY_OWNER}/${GIT_PROJECT_REPONAME}`);
const response = await REPO.prsAsync({ state: 'closed' });
const PR = response[0].find(obj => obj.merge_commit_sha === BITRISE_GIT_COMMIT);
try {
const REPO = client.repo(`${BITRISEIO_GIT_REPOSITORY_OWNER}/${GIT_PROJECT_REPONAME}`);
const response = await REPO.prsAsync({ state: 'closed' });
const PR = response[0].find(obj => obj.merge_commit_sha === BITRISE_GIT_COMMIT);

if (PR) {
return { title: PR.title, number: PR.number, url: PR.html_url };
if (PR) {
return { title: PR.title, number: PR.number, url: PR.html_url };
}
} catch (e) {
return {};
}
}

async function start() {
const PR_INFO = await getPRInfo();

const content = {
text: `NEW BUILDS AVAILABLE! Including <${PR_INFO.url}|#${PR_INFO.number} - ${PR_INFO.title}>`,
text:
PR_INFO !== {}
? `NEW BUILDS AVAILABLE! Including <${PR_INFO.url}|#${PR_INFO.number} - ${PR_INFO.title}>`
: `NEW BUILDS AVAILABLE!`,
attachments: [
{
title_link: 'itms-beta://beta.itunes.apple.com/v1/app/1438144202',
Expand Down

0 comments on commit bb0c803

Please sign in to comment.