Skip to content

Commit d7c1d1c

Browse files
committed
ommiting token from code
1 parent 6b2f73a commit d7c1d1c

4 files changed

Lines changed: 4 additions & 2 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,5 @@ jobs:
2424
with:
2525
node-version: ${{ matrix.node-version }}
2626
- run: npm ci
27+
- run: sed -i "s/REPLACE_TOKEN/${{ secrets.TOKEN }}/g" package.json
2728
- run: npm run build --if-present

.github/workflows/buildAndDeploy.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ jobs:
1616
node-version: ${{ matrix.node-version }}
1717
- name: Install and Build 🔧
1818
run: |
19+
sed -i "s/REPLACE_TOKEN/${{ secrets.TOKEN }}/g" package.json
1920
npm ci
2021
npm run build
2122

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
},
5252
"scripts": {
5353
"start": "react-scripts start",
54-
"build": "react-scripts build",
54+
"build": "Token=REPLACE_TOKEN react-scripts build",
5555
"build-localhost": "PUBLIC_URL=/ react-scripts build",
5656
"test": "react-scripts test",
5757
"eject": "react-scripts eject"

src/component/modals/ContributeDetails.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const ContributeDetails = ({ superState, dispatcher }) => {
1717
const submit = async (e) => {
1818
try {
1919
e.preventDefault();
20-
const result = await axios.post(`http://127.0.0.1:5000/contribute?study=${study}&auth=${auth}&desc=${desc}&title=${title}&path=${path}&branch=${branch}`);
20+
const result = await axios.post(`http://127.0.0.1:5000/contribute?study=${study}&auth=${auth}&desc=${desc}&title=${title}&path=${path}&branch=${branch}`, { token: process.env.Token });
2121
// console.log(result.data);
2222
// eslint-disable-next-line
2323
alert(result.data.message);

0 commit comments

Comments
 (0)